/* Fightplan /scorecard: what this page adds to the inner-page system (2026-11-21, KD-58).
   Loaded after styles.css and inner.css, on this page only; scorecard.js runs after site.js and inner.js.
   Tokens come from styles.css (brand-tokens.json). inner.css is used as it is for the hero's type (.in-hero) and
   the raised-fist closing (.final-fist). The old scorecard rules in styles.css (.sc-layout, .sc-board, .sc-total,
   .sc-meter, .sc-verdict) are no longer used by this page; the rounds' own classes (.crit, .opts, .o), which the
   page's inline script writes, are restyled here under .sc-rounds.
   Every default below is the still state: no JS and reduced motion both get it. scorecard.js adds the motion.
   Two layouts:
     one column    the default: phones, tablets, and any window under 1024 px wide or 640 px tall. The scorecard
                   strip stays under the header while the rounds pass; the full card follows the last round.
     two columns   at least 1024 px wide and 640 px tall: words and rounds on the left, the card on a black stage
                   on the right, held in view from the first screen to the last round.
   Blocks, in page order:
     .sc-stage     the one stage that holds the whole tool
     .sc-strip     one column only: the scorecard as a strip, a cell per round and the running total
     .sc-hero      the hero's words (inner.css .in-hero sets the type)
     .sc-rounds    the seven rounds: a name, a question and five answers as rows
     .sc-side      the black stage; .jc is the judge's card on it (a row per check, the total, the verdict)
     .sc-next      the next step, where the last round ends
   Hooks set by scorecard.js: .sc-js on <html>; .is-next on the round still waiting on the visitor (its block, its
   card row and its strip cell: the page's one red marker); .is-scored on an answered round's row and cell;
   .is-done on the stage when all seven are answered; .is-off on the strip while the card's total is on screen;
   --f on a row's bar (its fill, 0 to 1) and --z on the card (the hero's slow push, 1 to 1.05). */

/* ---------- The stage ---------- */
.sc-stage{position:relative;background:var(--bg);border-bottom:1px solid var(--border);
  --side:max(var(--gutter),calc((100% - 1120px) / 2))}
/* one column: the strip sits under the header, so whatever the page scrolls to (the button's target, an answer
   reached with the keyboard) stops below both. Two columns go back to the site's own figure, further down. */
html{scroll-padding-top:calc(var(--header-h) + 78px)}

/* ---------- The strip (one column only): a judge's card on one line. Seven cells, A to G, each with the points
   its round scored, then the running total. It stays under the header while the rounds pass. ---------- */
.sc-strip{position:sticky;top:calc(var(--header-h) + 1px);z-index:10;display:grid;grid-template-columns:minmax(0,1fr) auto;
  padding:0 var(--side);background:rgba(11,11,12,.94);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border-strong);transition:opacity 400ms var(--ease),visibility 0s linear 0s}
.sc-strip.is-off{opacity:0;visibility:hidden;transition:opacity 400ms var(--ease),visibility 0s linear 400ms}
.sc-cells{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.sc-cells li{position:relative;display:grid;justify-items:center;row-gap:4px;padding:9px 0 8px;border-right:1px solid var(--border)}
.sc-cells li:first-child{border-left:1px solid var(--border)}
.sc-cells i{font-style:normal;font-size:12px;font-weight:600;letter-spacing:.14em;margin-right:-.14em;line-height:1;color:var(--muted)}
.sc-cells b{font-family:var(--font-display);font-weight:700;font-size:22px;line-height:1;font-variant-numeric:tabular-nums;color:var(--muted)}
.sc-cells li.is-scored i{color:var(--fg-2)}
.sc-cells li.is-scored b{color:var(--fg)}
.sc-cells li.is-next::before{content:"";position:absolute;left:-1px;right:-1px;top:0;height:2px;background:var(--brand-red)}
.sc-cells li.is-next i{color:var(--fg)}
.sc-strip-total{display:flex;align-items:baseline;justify-content:flex-end;gap:5px;align-self:center;min-width:88px;padding-left:var(--space-3)}
.sc-strip-total b{font-size:32px;line-height:1}
.sc-strip-of{font-size:12px;font-weight:600;line-height:1;color:var(--muted);white-space:nowrap}
/* all seven answered: the tool's verdict takes the place of "/ 100", so the result reads on the strip itself.
   The longest ("Winning on points") sets in two lines beside the total. */
.sc-strip-verdict{display:none;max-width:4.6em;font-family:var(--font-display);font-weight:700;font-size:14px;letter-spacing:.02em;line-height:1;
  text-transform:uppercase;text-wrap:balance;color:var(--fg)}
.sc-stage.is-done .sc-strip-total{align-items:center;gap:7px}
.sc-stage.is-done .sc-strip-of{display:none}
.sc-stage.is-done .sc-strip-verdict{display:block}
@media (max-width:359px){
  /* the narrowest phones: a little smaller, so seven two-figure scores and the longest verdict share the strip */
  .sc-cells b{font-size:20px}
  .sc-strip-total{padding-left:var(--space-2)}
  .sc-strip-total b{font-size:28px}
  .sc-strip-verdict{font-size:13px}
}
@media (max-height:480px){
  /* a phone on its side: the strip would take too much of the screen, so it scrolls away with the page */
  .sc-strip{position:static}
}

/* ---------- Hero: the words. inner.css's .in-hero sets the label, the headline and the paragraph; here the block
   sits in this page's column instead of over a picture. ---------- */
.sc-stage .sc-hero{display:block;min-height:0;overflow:visible;padding:var(--space-7) var(--side)}
.sc-stage .sc-hero .in-hero-copy{margin:0;padding:0}
.sc-stage .sc-hero .display{font-size:clamp(52px,16.5vw,104px);max-width:none}
.sc-stage .sc-hero .lede{max-width:32em}
.sc-start{margin:0 0 var(--space-5)}
.sc-start .icon{width:18px;height:18px}
.sc-note{margin:0;max-width:62ch}
/* no JS: the tool cannot add up a score, so the page says so (.sc-nojs, inside a noscript), and the controls that
   would do nothing (the start button, the strip, the empty form, Clear answers) are not shown. They are hidden by
   a style inside a noscript in the page's head, not by the .no-js class: that class is only taken off once
   site.js runs, so hiding with it would make the button and the strip pop in after the first paint. */
.sc-nojs{margin:0 0 var(--space-5);max-width:36ch;font-size:var(--text-base);font-weight:600;line-height:1.45;color:var(--fg)}

/* ---------- The seven rounds. The inline script writes each one as .crit: a head (.crit-head: the letter, the
   name, the weight), the question (.crit-q) and five answers (.opts: a label holding a radio and its .o). The
   round still waiting on the visitor has a red line drawn across its top, as the fight-card rows do. ---------- */
.sc-rounds{padding:0 var(--side)}
.sc-rounds .crit{position:relative;max-width:760px;border-top:1px solid var(--border-strong);padding:var(--space-6) 0 var(--space-7)}
.sc-rounds .crit::after{content:"";position:absolute;left:0;top:-1px;width:100%;height:2px;background:var(--brand-red);transform:scaleX(0);transform-origin:0 50%}
.sc-rounds .crit.is-next::after{transform:scaleX(1);transition:transform 700ms var(--ease)}
.sc-rounds .crit-head{align-items:baseline;gap:var(--space-2) var(--space-4)}
.sc-rounds .crit-head h2{font-size:clamp(34px,9.6vw,46px);line-height:.95}
.sc-rounds .crit-head .letter{margin-right:.3em;color:var(--muted)}
.sc-rounds .crit-head .label{color:var(--fg-2)}
.sc-rounds .crit-q{margin:var(--space-3) 0 var(--space-5);max-width:44ch;font-size:19px;line-height:1.4;color:var(--fg-2)}
/* the five answers: rows that share their hairlines. 1, 3 and 5 carry a description; 2 and 4 sit between them,
   a little smaller. The chosen row turns white. */
.sc-rounds .opts{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
.sc-rounds .opts label{position:relative;display:block;margin-top:-1px;cursor:pointer}
.sc-rounds .opts label:first-child{margin-top:0}
.sc-rounds .opts label:hover,.sc-rounds .opts label:focus-within{z-index:1}
.sc-rounds .opts input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.sc-rounds .opts .o{display:grid;grid-template-columns:40px minmax(0,1fr);gap:0 var(--space-3);align-items:center;align-content:center;
  min-height:58px;padding:10px var(--space-4);background:var(--surface);border:1px solid var(--border-strong);color:var(--fg);
  transition:background-color 400ms var(--ease),border-color 400ms var(--ease),color 400ms var(--ease)}
.sc-rounds .opts .o b{font-family:var(--font-display);font-weight:700;font-size:30px;line-height:1;font-variant-numeric:tabular-nums;transition:color 400ms var(--ease)}
.sc-rounds .opts .o span{display:block;font-size:var(--text-md);line-height:1.35;color:var(--fg-2);transition:color 400ms var(--ease)}
.sc-rounds .opts .o:not(.anchor){min-height:48px;padding-top:8px;padding-bottom:8px;background:transparent}
.sc-rounds .opts .o:not(.anchor) b{font-size:24px;color:var(--fg-2)}
.sc-rounds .opts .o:not(.anchor) span{display:block;font-size:var(--text-sm);color:var(--muted)}
.sc-rounds .opts label:hover .o{border-color:rgba(255,255,255,.5)}
.sc-rounds .opts input:checked + .o{background:var(--fg);border-color:var(--fg);color:var(--bg)}
.sc-rounds .opts input:checked + .o b{color:var(--bg)}
.sc-rounds .opts input:checked + .o span{color:var(--surface-3)}
.sc-rounds .opts input:focus-visible + .o{outline:2px solid var(--fg);outline-offset:2px}
@media (max-width:767px){
  .sc-rounds .crit{padding:var(--space-5) 0 var(--space-6)}
  .sc-rounds .crit-q{font-size:17px;margin-bottom:var(--space-4)}
  .sc-rounds .opts .o{padding-left:var(--space-3);padding-right:var(--space-3)}
}

/* ---------- The black stage and the judge's card. Every size inside the card is in em, so the card scales as one
   piece from its own font size. One column: the card sits on a black band after the last round. ---------- */
.sc-side{padding:var(--space-6) var(--side);background:var(--black);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.sc-stick{display:flex;justify-content:center}
.jc{position:relative;width:min(100%,27em);padding:1.5em 1.6em 1.6em;font-size:16px;line-height:1.4;background:var(--surface-2);color:var(--fg);
  clip-path:polygon(1.375em 0,100% 0,100% calc(100% - 1.375em),calc(100% - 1.375em) 100%,0 100%,0 1.375em)}
.jc-head{display:flex;justify-content:space-between;align-items:baseline;gap:1em;padding-bottom:.9em;border-bottom:1px solid var(--border-strong)}
/* no text on the card is set under 12 px, however small the card is drawn */
.jc-head .label{font-size:max(12px,.75em);color:var(--fg-2)}
.jc-head .label + .label{color:var(--muted);text-align:right}
/* a row per check: its letter and name, a track as long as its weight, the points scored, and what they are out of */
.jc-rows{list-style:none;margin:0;padding:0}
.jc-rows li{position:relative;display:grid;grid-template-columns:1.2em max(5.3em,76px) minmax(0,1fr) 1.9em max(2.3em,30px);column-gap:.6em;align-items:center;
  height:2.3em;border-bottom:1px solid var(--border)}
.jc-k{font-family:var(--font-display);font-weight:700;font-size:1.05em;line-height:1;color:var(--muted)}
.jc-n{font-size:max(12px,.75em);font-weight:600;letter-spacing:.14em;text-transform:uppercase;line-height:1;color:var(--fg-2);white-space:nowrap;transition:color 400ms var(--ease)}
.jc-bar{position:relative;display:block;height:2px}
.jc-bar::before,.jc-bar::after{content:"";position:absolute;left:0;top:0;height:100%;width:calc(var(--w,1) * 100%);transform-origin:0 50%}
.jc-bar::before{background:var(--border-strong)}
.jc-bar::after{background:var(--fg);transform:scaleX(var(--f,0));transition:transform 500ms var(--ease)}
.jc-p{font-family:var(--font-display);font-weight:700;font-size:1.5em;line-height:1;text-align:right;font-variant-numeric:tabular-nums;color:var(--muted)}
.jc-of{font-size:max(12px,.8em);line-height:1;color:var(--muted);white-space:nowrap}
.jc-rows li.is-scored .jc-p,.jc-rows li.is-scored .jc-k{color:var(--fg)}
.jc-rows li.is-scored .jc-n{color:var(--fg)}
/* the round still waiting on the visitor: a red marker on the card's left edge */
.jc-rows li.is-next::before{content:"";position:absolute;left:-1.6em;top:-1px;bottom:-1px;width:3px;background:var(--brand-red)}
.jc-rows li.is-next .jc-n,.jc-rows li.is-next .jc-k{color:var(--fg)}
/* the total, like a round score, with the verdict beside it */
.jc-sum{display:flex;justify-content:space-between;align-items:flex-end;gap:1em;padding-top:1.2em}
.jc-total{display:flex;align-items:baseline;gap:.5em}
.jc-total .num{font-size:5.4em;line-height:.8;margin-left:-.03em}
.jc-total .num + span{font-size:1.2em;line-height:1;color:var(--muted);white-space:nowrap}
.jc-verdict{margin:0;max-width:5.4em;font-family:var(--font-display);font-weight:700;font-size:1.9em;line-height:.95;text-transform:uppercase;text-align:right;text-wrap:balance}
/* The tool sets the fill's width as a scaleX on #meter. The fill is given its own layer (will-change): drawn into
   the card's layer while the card is mid-push, Edge and Chrome left a light edge along the bottom and right of the
   whole track (measured 2026-11-21; gone with the layer). */
.jc-meter{position:relative;height:6px;margin:1.1em 0 .55em;background:var(--bg)}
.jc-meter i{position:absolute;inset:0;transform-origin:0 50%;transform:scaleX(0);background:var(--fg);transition:transform 500ms var(--ease);will-change:transform}
.jc-meter .tick{position:absolute;top:0;bottom:0;width:2px;background:var(--muted)}
.jc-ticks{margin:0;font-size:max(12px,.8125em);line-height:1.45;color:var(--muted)}
.jc-advice{margin:.9em 0 0;padding-top:.9em;min-height:calc(.9em + 4 * 1.45em);border-top:1px solid var(--border-strong);
  font-size:max(12px,.9375em);line-height:1.45;color:var(--fg-2)}
.sc-stage.is-done .jc-advice{color:var(--fg)}

/* ---------- The next step: the three controls and the line under them, where the last round ends ---------- */
.sc-next{padding:var(--space-6) var(--side) var(--space-8)}
.sc-next-in{position:relative;max-width:760px}
.sc-next .actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3)}
.sc-next .sc-clear{margin-left:auto}
.sc-next p{margin:var(--space-4) 0 0;max-width:54ch}
/* Red marks what is waiting on the visitor. While rounds are still open that is the round in play, so the send
   button stays grey; once all seven are answered it is the page's red button. No JS: the page's own red button. */
.sc-send{transition:background-color 400ms var(--ease),color 400ms var(--ease)}
.sc-js .sc-stage:not(.is-done) .sc-send{background:var(--surface-3);color:var(--fg)}
.sc-js .sc-stage:not(.is-done) .sc-send:hover{background:var(--surface-2)}
.sc-js .sc-stage:not(.is-done) .sc-send:focus-visible{outline-color:var(--fg)}
/* unavailable until all seven are answered (the tool's script; the line under the buttons says why): no hover change */
.sc-send[aria-disabled="true"]{cursor:not-allowed}
.sc-js .sc-stage:not(.is-done) .sc-send[aria-disabled="true"]:hover{background:var(--surface-3)}
@media (max-width:767px){
  .sc-next{padding-top:var(--space-5);padding-bottom:var(--space-7)}
  .sc-next .actions{flex-direction:column;align-items:stretch;gap:var(--space-2)}
  .sc-next .sc-clear{margin-left:0}
}

/* ---------- Two columns: at least 1024 px wide and 640 px tall ---------- */
@media (min-width:1024px) and (min-height:640px){
  /* twelve columns from the page's left margin to the right edge: the words and the rounds on six, the stage on six */
  html{scroll-padding-top:calc(var(--header-h) + 24px)}
  /* --jc-f is the card's type size, the one number the card and the foot of the column are both worked out from:
     from the window's height (the card is about 37.5 units tall, and its push ends at 1.05) and from the stage's
     width (27 units across, 86% of half the page from its left margin), whichever is smaller */
  .sc-stage{display:grid;grid-template-columns:var(--side) minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto auto;
    --jc-f:clamp(12.5px,min(calc((100vh - 125px) / 39.5),calc((100vw - max(var(--gutter),(100vw - 1120px) / 2)) * .015)),20px)}
  .sc-strip{display:none}
  /* the hero: one screen tall, the words low-left, as on the other inner pages. The headline is sized from the
     window's height as well as its width, so the label, three lines of headline, the paragraph, the button and
     the note share the first screen. */
  .sc-stage .sc-hero{grid-column:2;grid-row:1;display:flex;align-items:flex-end;padding:0 var(--space-7) 0 0;
    min-height:min(calc(100vh - 105px),1000px);min-height:min(calc(100svh - 105px),1000px)}
  .sc-stage .sc-hero .in-hero-copy{padding:var(--space-7) 0}
  .sc-stage .sc-hero .display{font-size:min(clamp(52px,8.6vw,132px),max(60px,calc((100vh - 520px) / 2.7)));max-width:4.3em}
  .sc-stage .sc-hero .lede{max-width:30em}
  .sc-rounds{grid-column:2;grid-row:2;padding:0 var(--space-7) 0 0}
  .sc-rounds .crit{max-width:none}
  .sc-rounds .crit-head h2{font-size:clamp(36px,3.5vw,50px)}
  /* the next step closes the column the way a round opens: a hairline across its top, and, once all seven are
     answered, the red line that has moved from round to round.
     The foot under it is as deep as the card needs: the card leaves with the end of the stage, so the stage runs on
     until the whole card (38.5 units with its push, plus the header's 94 px) still fits above that end while the
     Send row is 40% of the way down the window. Result: the verdict and the advice stay whole beside the three
     controls. Never less than the page's usual section foot. */
  .sc-next{grid-column:2;grid-row:3;padding:0 var(--space-7) max(var(--space-9),calc(var(--jc-f) * 38.5 - 40vh - 8px)) 0}
  .sc-next-in{max-width:none;padding-top:var(--space-6);border-top:1px solid var(--border-strong)}
  .sc-next-in::after{content:"";position:absolute;left:0;top:-1px;width:100%;height:2px;background:var(--brand-red);transform:scaleX(0);transform-origin:0 50%}
  .sc-stage.is-done .sc-next-in::after{transform:scaleX(1);transition:transform 700ms var(--ease)}
  /* The stage runs the height of the tool; the card is held in view under the header, in the middle of the room
     it has there, at the size --jc-f gives it. --c is the gap between the header and the card that centres it.
     The card's own box is what sticks, so it only starts to leave when the end of the stage reaches its foot. At
     the top of the page the strip over the header is still on screen (36 px), so the card starts that much lower
     and does not move as the strip scrolls away. */
  .sc-side{grid-column:3;grid-row:1 / 4;display:flex;justify-content:center;align-items:flex-start;padding:0 7% var(--space-5);
    border-top:0;border-bottom:0;border-left:1px solid var(--border)}
  .sc-stick{display:block;flex:none;font-size:var(--jc-f);
    --c:max(20px,calc((100vh - var(--header-h) - 1px - 37.2em) / 2));
    position:sticky;top:calc(var(--header-h) + 1px + var(--c));margin-top:max(0px,calc(var(--c) - 36px))}
  .jc{width:27em;font-size:1em;transform:scale(var(--z,1));transform-origin:50% 50%}
}

/* ---------- Motion that needs no script: when the page opens, the seven tracks draw in one after another;
   a score and the verdict come up when they arrive ---------- */
@media (prefers-reduced-motion:no-preference){
  .jc-bar::before{animation:jc-draw 600ms var(--ease) both;animation-delay:calc(var(--i,0) * 70ms + 250ms)}
  .jc-rows li.is-scored .jc-p{animation:jc-in 400ms var(--ease) both}
  .sc-stage.is-done .jc-verdict{animation:jc-in 500ms var(--ease) both}
}
@keyframes jc-draw{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes jc-in{from{opacity:0;transform:translateY(.3em)}to{opacity:1;transform:none}}

/* QA renders (?shot=...): nothing mid-move */
.is-shot .jc-bar::before,.is-shot .jc-rows li.is-scored .jc-p,.is-shot .sc-stage.is-done .jc-verdict{animation:none}

/* Windows contrast themes repaint every background, so the chosen answer and the bars' fills get an edge of their own */
@media (forced-colors:active){
  .sc-rounds .opts input:checked + .o{outline:3px solid Highlight;outline-offset:-4px}
  .sc-rounds .opts input:focus-visible + .o{outline:3px solid CanvasText;outline-offset:2px}
  .jc-bar::after,.jc-meter i{background:Highlight}
  .jc-bar::before,.jc-meter{background:GrayText}
}

@media (prefers-reduced-motion:reduce){
  .sc-strip,.sc-strip.is-off,.sc-rounds .crit.is-next::after,.sc-stage.is-done .sc-next-in::after,.sc-rounds .opts .o,.sc-rounds .opts .o b,
  .sc-rounds .opts .o span,.jc-n,.jc-bar::after,.jc-meter i,.sc-send{transition:none}
  .jc{transform:none}
}
