/* Fightplan Work pages: the hub (/work) and the case pages (/work/<name>) (2026-11-20, KD-58).
   Loaded after styles.css and inner.css; work.js runs after site.js and inner.js. Tokens come from styles.css
   (brand-tokens.json). inner.css gives these pages the hero, the pinned-stage layout (.pin), the device frames,
   the round marker, the compact rows, the fight-card rows, the still stage (.show) and the raised-fist closing.
   This file adds only what the Work pages need on top of it.
   Every default below is the still state: no JS and reduced motion both get it. work.js adds the motion.
   Blocks:
     .wk-index           the three jump links under the hub's hero line
     .wk-stage           a stage whose work is pages scrolling inside frames (on .pin; work.js pins and plays it)
     .wk-wide            the same stage at full width, no words beside it (case pages)
     .wk-duo / .wk-tall / .wk-pair   the three ways the frames sit on a stage
     .wk-trio            three vertical videos side by side, each a still in a 9:16 phone frame (2026-11-21)
     .wk-tag             the "Concept work. Invented client." tag
     .wk-block-head      the heading of a block of stages (the concept block)
     .case-hero          a case page's title, its one-line summary and the link to the live thing
     .wk-facts           what we made, as fight-card rows
     .wk-still           a still that takes a slow push as it crosses the screen (inner.js, [data-push])
     .wk-next            the link to the next case
   To add a concept piece to the hub: copy one <section class="pin wk-stage"> inside the concept block in
   work.html, give it its own id, number and pictures, and keep its "Concept work. Invented client." tag and
   caption. The round marker counts the stages on the page by itself. */

/* ---------- Hub hero: the three pieces as jump links, on the dark side under the line ---------- */
/* the cage fence left of the door is lit, so the fade to the page's black runs further right than inner.css's
   (it stops short of the door); every line of type keeps 4.5:1 or better over the brightest wire behind it */
@media (min-width:768px) and (min-aspect-ratio:1/1){
  .wk-hero .in-hero-photo::after{background:
    linear-gradient(90deg,var(--bg) 0%,rgba(11,11,12,.95) 36%,rgba(11,11,12,.86) 54%,rgba(11,11,12,0) 66%),
    linear-gradient(180deg,var(--bg) 0%,rgba(11,11,12,0) 8%),
    linear-gradient(0deg,var(--bg) 0%,rgba(11,11,12,0) 20%)}
}
.wk-index{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;max-width:min(40em,48vw);border-top:1px solid var(--border-strong)}
.wk-index li{margin:0}
.wk-index a{display:flex;align-items:baseline;gap:10px;min-height:48px;padding:14px var(--space-6) 0 0;color:var(--fg);text-decoration:none;
  font-family:var(--font-display);font-weight:700;font-size:24px;line-height:1;letter-spacing:.01em;text-transform:uppercase;
  transition:color 400ms var(--ease)}
.wk-index a span{font-size:15px;letter-spacing:.1em;color:var(--muted);transition:color 400ms var(--ease)}
.wk-index a:hover{color:var(--fg-2)}
.wk-index a:hover span{color:var(--fg-2)}
@media (max-width:767px),(max-aspect-ratio:1/1){
  .wk-index{max-width:none}
}
/* small laptops (two columns, at most 800 px tall): the headline, the line and the ten links fit the first screen.
   Slightly tighter gaps and 44 px link rows; taller windows and phones keep the spacing above (2026-11-22). */
@media (min-width:768px) and (min-aspect-ratio:1/1) and (max-height:800px){
  .wk-hero .in-hero-copy{padding-bottom:56px}
  .wk-hero h1{margin-bottom:var(--space-4)}
  .wk-hero .lede{margin-bottom:var(--space-5)}
  .wk-index a{min-height:44px}
}
@media (max-width:767px){
  .wk-index{display:grid;grid-template-columns:minmax(0,1fr);border-top:0}
  .wk-index a{min-height:48px;padding:14px 0;border-top:1px solid var(--border-strong);font-size:22px}
  .wk-index li:last-child a{border-bottom:1px solid var(--border)}
}

/* ---------- Device frames: what inner.css leaves to the page ---------- */
.frame-phone .frame-view{aspect-ratio:390 / 844}
/* a photograph in a frame, cropped at its sides only (her head and hands stay whole) */
.frame-photo{display:grid}
.frame-photo .frame-view{aspect-ratio:568 / 676;min-height:100%}
.frame-photo img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:50% 0}

/* ---------- A stage of scrolling pages ---------- */
/* an in-page link to a stage lands with the stage's top edge at the top of the window, where it pins */
.wk-stage{--n:2;scroll-margin-top:calc(-1 * (var(--header-h) + 24px))}
.wk-stage .pin-text{container-type:inline-size}
/* the name of the work: one size for every stage (the longest word has to fit the column), as on the homepage */
.pin.wk-stage .pin-title.wk-name{font-size:clamp(48px,17vw,92px);line-height:.88}
@supports (width:1cqi){
  .wk-stage .pin-head{--ts:clamp(48px,min(21cqi,max(72px,calc((100vh - 450px) / 3.6))),148px)}
  .pin.wk-stage .pin-title.wk-name{font-size:var(--ts)}
}
.wk-stage .pin-line b{font-weight:600;color:var(--fg)}
.wk-stage .pin-line a{color:var(--fg);text-underline-offset:3px}
.wk-stage .cta-row{margin-top:var(--space-5);gap:var(--space-3) var(--space-5)}
.wk-stage .link-arrow .icon{width:18px;height:18px}
.wk-tag{display:inline-block;margin-top:var(--space-4);padding:5px 8px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;line-height:1;
  color:var(--bg);background:var(--fg-2)}
/* the piece is sized from the stage it sits on (container units), so it fills the stage at any size */
.wk-piece{container-type:size;container-name:piece}
.wk-rig{width:100%;display:grid;gap:3.5%;align-items:center}
/* a phone frame and a browser frame, side by side (.rev: the browser first) */
.wk-duo{grid-template-columns:minmax(0,.42fr) minmax(0,.58fr)}
.wk-duo.rev{grid-template-columns:minmax(0,.58fr) minmax(0,.42fr)}
/* a tall browser frame with a phone frame beside it */
.wk-tall{grid-template-columns:minmax(0,2.3fr) minmax(0,1fr)}
/* a photograph and a phone frame, two tall panels */
.wk-pair{grid-template-columns:minmax(0,.54fr) minmax(0,.46fr);align-items:stretch}
.wk-pair .frame-phone{align-self:center}
/* a pair of frames with two facts under it (inner.css .specs) */
.wk-set{width:100%}
.wk-set .specs{padding-bottom:0;max-width:none}
@media (min-width:768px){
  /* not pinned (tablets, short windows, reduced motion, no JS): the stage keeps a height of its own */
  .wk-stage .pin-piece{height:60vh;height:60svh;min-height:400px}
  @supports (width:1cqh){
    /* the phone frame sets the height of a pair of frames */
    .wk-duo{width:min(100%,105cqh)}
    /* with two facts under the pair: the phone frame and the two lines of text share the stage's height */
    .wk-set{width:min(100%,calc((92cqh - 104px) * 1.14))}
    .wk-set .wk-duo{width:100%}
    /* the browser frame takes the stage's height; the phone keeps its own shape */
    .wk-tall{width:min(100%,145cqh);height:min(92cqh,100cqw);grid-template-rows:minmax(0,1fr)}
    .wk-tall .frame-browser{display:flex;flex-direction:column;height:100%}
    .wk-tall .frame-browser .frame-view{flex:1;min-height:0;aspect-ratio:auto}
    /* both panels take the stage's height; the photo is cropped at its sides only */
    .wk-pair{width:min(100%,96cqh);height:min(92cqh,96cqw);grid-template-rows:minmax(0,1fr)}
    .wk-pair .frame-photo .frame-view{aspect-ratio:auto;height:100%}
  }
}
@media (min-width:1024px){
  .wk-stage .pin-piece{height:min(86vh,800px);min-height:560px}
}
/* pinned (work.js adds .is-pinned on wide screens with motion on): the words sit in the middle of the room between
   the header and the round marker, level with the middle of the work */
.wk-stage.is-pinned .pin-text{justify-content:center;padding-top:calc(var(--header-h) + var(--space-4));padding-bottom:calc(var(--space-6) + 56px)}
.wk-stage.is-pinned .pin-piece{height:auto;min-height:0}
@media (max-width:767px){
  /* phones: the work takes the screen's width and as much height as it needs; the frames stack */
  .wk-stage .pin-piece{display:block;padding:6% 6% 0;container-type:inline-size}
  .wk-rig,.wk-duo.rev{grid-template-columns:minmax(0,1fr);gap:14px;justify-items:center}
  .wk-rig .frame-browser,.wk-rig .frame-photo{width:100%}
  .wk-rig .frame-phone{width:62%}
  .wk-tall .frame-browser .frame-view{aspect-ratio:4 / 3}
  .wk-pair .frame-photo .frame-view{aspect-ratio:3 / 2;min-height:0}
}

/* ---------- Three vertical videos in a row (2026-11-21, stage 09 Five Shorts) ---------- */
/* each Short's first frame, 9:16, in a phone frame cut to the same shape; a still, so nothing scrolls inside it.
   Every rule names .wk-trio, so none can reach another stage. */
.wk-rig.wk-trio{grid-template-columns:repeat(3,minmax(0,1fr))}
.wk-trio .frame-phone .frame-view{aspect-ratio:9 / 16}
.wk-trio .frame-view img{display:block;width:100%;height:auto}
@media (min-width:768px){
  /* the phones' height sets the row's width: three 9:16 frames and two gaps stay inside the stage's height */
  @supports (width:1cqh){.wk-trio{width:min(100%,160cqh)}}
}
@media (max-width:767px){
  /* phones: still three in a row, across the screen's width */
  .wk-rig.wk-trio{gap:10px}
  .wk-rig.wk-trio .frame-phone{width:100%}
}

/* ---------- The same stage at full width (case pages): no words beside it, the frames at their largest ---------- */
.wk-wide .wk-duo{grid-template-columns:minmax(0,.25fr) minmax(0,.75fr)}
.wk-wide .wk-duo.rev{grid-template-columns:minmax(0,.75fr) minmax(0,.25fr)}
@media (min-width:768px){
  /* never past the pictures' own sizes: a browser page is 1000 px wide, a phone page 390 px or more */
  @supports (width:1cqh){.wk-wide .wk-duo{width:min(100%,170cqh,1380px)}}
}
@media (min-width:1024px){
  .wk-wide .pin-box{grid-template-columns:minmax(0,1fr)}
  .wk-wide .pin-work{grid-column:1;border-left:0}
}
@media (max-width:767px){
  .wk-wide .wk-duo,.wk-wide .wk-duo.rev{grid-template-columns:minmax(0,1fr)}
}
/* a page with one stage has nothing to count, so it shows no marker */
.round.is-solo{display:none}

/* ---------- The heading of a block of stages ---------- */
.wk-block{border-top:1px solid var(--border);padding:var(--space-9) 0 var(--space-8)}
.wk-block-head{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);column-gap:var(--space-7);align-items:end}
.wk-block-head h2{font-size:clamp(44px,6.4vw,92px);line-height:.9}
.wk-block-head .lede{margin:0 0 6px;font-size:var(--text-base);line-height:1.5;max-width:44ch}
@media (max-width:1023px){
  .wk-block-head{grid-template-columns:minmax(0,1fr);row-gap:var(--space-4)}
}
@media (max-width:767px){
  .wk-block{padding:var(--space-8) 0 var(--space-7)}
  .wk-block-head .lede{font-size:var(--text-md)}
}

/* ---------- Rows after a stage ---------- */
.pin + .quiet{border-top:1px solid var(--border)}
.wk-links p{margin:0}
.wk-links .link-arrow{color:var(--fg-2);min-height:44px}
.wk-links .link-arrow:hover{color:var(--fg)}

/* ---------- Case page: the title, the one-line summary, the link to the live thing ---------- */
.case-hero{background:var(--bg);padding:var(--space-7) 0 var(--space-7)}
.case-back{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:var(--text-xs);font-weight:600;letter-spacing:.14em;text-transform:uppercase;
  line-height:1.4;color:var(--fg-2);text-decoration:none;transition:color 400ms var(--ease)}
.case-back .icon{width:16px;height:16px;transition:transform 400ms var(--ease)}
.case-back:hover{color:var(--fg)}
.case-back:hover .icon{transform:translateX(-4px)}
.case-hero h1{margin:var(--space-6) 0 0}
.case-hero h1 > .label{margin-bottom:var(--space-4);color:var(--fg-2)}
.case-hero h1 > .label::before{content:"";width:24px;height:2px;background:currentColor}
/* the hero line's size on every inner page; the closing stays the largest type */
.case-hero .display{font-size:min(clamp(52px,8.6vw,132px),max(64px,calc((100vh - 450px) / 3.6)));line-height:.9}
.case-hero .wk-tag{margin-top:var(--space-5)}
.case-sum{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);column-gap:var(--space-7);align-items:end;
  margin-top:var(--space-6);padding-top:var(--space-5);border-top:1px solid var(--border-strong)}
.case-sum .lede{margin:0;max-width:36em}
.case-sum .lede a{color:var(--fg);text-underline-offset:3px}
.case-act{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--space-3) var(--space-5)}
.case-aside{font-size:var(--text-sm);line-height:1.4;color:var(--muted)}
.case-act .btn .icon{width:18px;height:18px}
@media (max-width:1023px){
  .case-sum{grid-template-columns:minmax(0,1fr);row-gap:var(--space-5)}
  .case-act{justify-content:flex-start}
}
@media (max-width:767px){
  .case-hero{padding:var(--space-5) 0 var(--space-6)}
  .case-hero h1{margin-top:var(--space-5)}
  .case-hero h1 > .label{margin-bottom:10px}
  .case-hero .display{font-size:clamp(52px,16.5vw,104px)}
  .case-sum{margin-top:var(--space-5)}
  .case-sum .lede{font-size:var(--text-md);line-height:1.45}
  .case-act{flex-direction:column;align-items:stretch;gap:var(--space-2)}
  .case-act .btn{width:100%}
}

/* ---------- What we made: fight-card rows (inner.css .card .bout), a name and its line, no price ---------- */
.wk-facts .bout{grid-template-columns:minmax(0,1fr)}
.wk-facts .bout.has-art{grid-template-columns:minmax(0,1fr) minmax(0,260px);align-items:center}
.wk-facts .bout h3{font-size:26px;line-height:1}
.wk-facts .bout p b{font-weight:600;color:var(--fg)}
.wk-facts .bout p a{color:var(--fg-2);text-underline-offset:3px}
.wk-facts .bout p a:hover{color:var(--fg)}
.wk-facts .bout .amt{min-width:0}
.wk-facts .bout .amt img{display:block;width:100%;max-width:260px;height:auto;margin-left:auto}
@media (min-width:768px){
  /* the names share one column, so every line starts on the same edge, with or without a picture */
  .wk-facts .bout > div:first-child{grid-template-columns:minmax(0,200px) minmax(0,1fr)}
  .wk-facts .bout p{max-width:62ch}
}
@media (max-width:767px){
  .wk-facts .bout,.wk-facts .bout.has-art{grid-template-columns:minmax(0,1fr)}
  .wk-facts .bout h3{grid-column:1;grid-row:1;font-size:24px}
  .wk-facts .bout p{grid-row:2}
  .wk-facts .bout .amt{grid-column:1;grid-row:3;text-align:left;padding-top:var(--space-2)}
  .wk-facts .bout .amt img{max-width:200px;margin-left:0}
}

/* ---------- A still with a slow push (inner.js sets --z on [data-push]) ---------- */
/* the frame is capped so the picture is never shown past its own size, even at the end of its push */
.wk-still{display:block;overflow:hidden;width:100%;max-width:536px;background:var(--black)}
.wk-still img{display:block;width:100%;height:auto;transform:scale(var(--z,1));transform-origin:50% 0;will-change:transform}
.show-work .wk-still + .work-cap{padding-bottom:var(--space-6)}
/* three pages of a demo site, names only */
.walk3-cap b:only-child{margin-bottom:0}

/* ---------- The link to the next case ---------- */
.wk-next{border-top:1px solid var(--border)}
.quiet + .wk-next{margin-top:var(--space-8)}
.wk-next a{display:block;padding:var(--space-8) 0;color:var(--fg);text-decoration:none}
.wk-next .wrap{display:block}
.wk-next a:focus-visible{outline:2px solid var(--fg);outline-offset:-4px}
.wk-next .label{display:block;margin-bottom:var(--space-3);color:var(--fg-2)}
.wk-next-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-5)}
.wk-next strong{font-family:var(--font-display);font-weight:700;font-size:clamp(44px,6.4vw,92px);line-height:.9;text-transform:uppercase}
.wk-next .icon{width:clamp(32px,4vw,56px);height:clamp(32px,4vw,56px);color:var(--fg-2);transition:transform 400ms var(--ease),color 400ms var(--ease)}
.wk-next a:hover .icon{transform:translateX(8px);color:var(--fg)}
.wk-next + .final{margin-top:0}
@media (max-width:767px){
  .wk-next a{padding:var(--space-7) 0}
}

@media (prefers-reduced-motion:reduce){
  .wk-index a,.wk-index a span,.case-back,.case-back .icon,.wk-next .icon{transition:none}
}
