/* ==========================================================================
   Data Science — shared kit (copied from apps/trainer, plus the Bench styles below)
   Every page loads this. Do not edit per page; add page-specific rules in
   the page's own <style> if you must, and prefer not to.
   ========================================================================== */

/* The house palette (packages/theme/theme.css), light only. The names are the
   dark kit's, kept so no page had to change: --bg is the paper, --surface the
   panel, --cream the ink. The six hues are the same as trainer's and as
   AK.C in kit.js, chosen to read on paper. */
:root{
  color-scheme:light;
  --bg:#f5f2ed;          /* paper */
  --surface:#fbf9f5;     /* panel */
  --surface-2:#eeeae3;   /* surface: a band inside a panel, controls, tabs, the rail */
  --line:#d8d4cd;        /* rule */
  --line-soft:#e7e3dc;   /* rule-soft */
  --cream:#1a3a2a;       /* ink */
  --muted:#5f5c55;       /* a step darker than the house muted, so small grey text reads */
  --dim:#6e6b64;
  --accent:#b08d57;
  --gold:#a87d08;
  --blue:#24558f;
  --teal:#1a94a4;
  --green:#2f6b4f;
  --purple:#9468b4;
  --red:#a8443a;
  --math:'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --mono:'DM Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  /* the house's own names, which house-bar.css reads */
  --paper:var(--bg); --panel:var(--surface); --ink:var(--cream);
  --rule:var(--line); --rule-soft:var(--line-soft);
  --heading:var(--math); --body:var(--sans); --label:var(--mono);
  --house-bar-width:980px;
}
::selection{background:var(--accent); color:#fff;}

*{box-sizing:border-box}
html{scroll-behavior:smooth;}
body{
  margin:0; background:var(--bg); color:var(--cream);
  font-family:var(--sans); font-size:16px; line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
/* The page as a page, as on every page of the site (packages/theme/theme.css, --frame):
   on a screen wider than the page, the page keeps to the middle with a fine line down
   each side, and the screen either side is a shade deeper than the paper. */
:root{--frame:84rem; --frame-rule:#cfc8bd; --surround:#ebe6de;}
body{max-width:var(--frame); margin-inline:auto; min-height:100vh; min-height:100dvh; box-shadow:-1px 0 0 var(--frame-rule), 1px 0 0 var(--frame-rule);}
@media (min-width:84rem){html{background:var(--surround);}}
.wrap{max-width:980px; margin:0 auto; padding-inline:20px; padding-block:clamp(30px,5vw,58px);}
.prose{max-width:66ch;}

/* ---------- type ---------- */
h1{
  font-family:var(--math); font-weight:500; font-size:clamp(36px,6.2vw,60px);
  line-height:1.05; letter-spacing:-.015em; margin:0 0 14px; text-wrap:balance;
}
h2{
  font-family:var(--math); font-weight:500; font-size:clamp(26px,3.6vw,34px);
  line-height:1.15; letter-spacing:-.01em; margin:0 0 4px; text-wrap:balance;
}
h3{font-family:var(--sans); font-weight:600; font-size:15px; margin:0 0 8px; color:var(--cream);}
p{margin:0 0 16px;}
a{color:var(--cream); text-decoration:underline; text-decoration-color:var(--accent); text-decoration-thickness:1px; text-underline-offset:3px;}
a:hover{text-decoration-thickness:2px;}
/* Links are the ink, underlined in brass, and the focus ring is brass, as on every page of the site:
   the hues below are for the figures, not for anything you can press. */
.eyebrow{
  font-size:12px; letter-spacing:.16em; text-transform:uppercase; font-weight:600;
  color:var(--dim); margin:0 0 12px; display:flex; gap:14px; align-items:baseline; flex-wrap:wrap;
}
.eyebrow .back{color:var(--cream); letter-spacing:.1em;}
.eyebrow .back:hover{text-decoration:underline;}
.standfirst{font-size:18px; color:var(--muted); max-width:62ch; margin:0 0 8px;}
.standfirst strong{color:var(--cream); font-weight:400;}
.lede{color:var(--muted);}
em.term{font-style:normal; color:var(--cream); border-bottom:1px solid var(--line);}
.gold{color:var(--gold);} .blue{color:var(--blue);} .red{color:var(--red);} .green{color:var(--green);}

section{margin-top:clamp(44px,6vw,72px);}
.sec-head{display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:10px;}
.kicker{
  font-family:var(--sans); font-size:11.5px; letter-spacing:.16em; text-transform:uppercase;
  font-weight:600; padding:3px 8px; border:1px solid var(--line); border-radius:2px; color:var(--dim);
  white-space:nowrap;
}
.kicker.gold{color:var(--gold); border-color:rgba(168,125,8,.4);}
.kicker.blue{color:var(--blue); border-color:rgba(36,85,143,.4);}
.kicker.teal{color:var(--teal); border-color:rgba(26,148,164,.4);}
.kicker.green{color:var(--green); border-color:rgba(47,107,79,.4);}
.kicker.purple{color:var(--purple); border-color:rgba(148,104,180,.4);}
.kicker.red{color:var(--red); border-color:rgba(168,68,58,.4);}

/* ---------- panel: figure + controls + readout ---------- */
.panel{
  background:var(--surface); border:1px solid var(--line-soft); border-radius:4px;
  margin-top:20px; overflow:hidden;
}
.fig{width:100%; padding:14px 14px 4px;}
.fig svg{display:block; width:100%; height:auto; max-width:100%;}
.fig-foot{padding:0 16px 14px; margin:0; color:var(--muted); font-size:14px; line-height:1.5;}
/* a label that sits on top of the data: a rim of the panel keeps it legible */
svg text.halo{paint-order:stroke; stroke:var(--surface); stroke-width:4px; stroke-linejoin:round;}

.controls{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px 22px;
  padding:16px; border-top:1px solid var(--line-soft); background:var(--surface-2);
}
.ctl{display:flex; flex-direction:column; gap:5px; min-width:0;}
.ctl label{
  font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; font-weight:600;
  color:var(--dim); display:flex; justify-content:space-between; align-items:baseline; gap:10px;
}
.ctl output{
  font-family:var(--math); font-size:19px; color:var(--cream);
  letter-spacing:0; text-transform:none; font-variant-numeric:lining-nums tabular-nums;
}
input[type=range]{width:100%; accent-color:var(--cream); cursor:pointer; margin:0;}
input[type=range]:focus-visible, button:focus-visible, a:focus-visible, [tabindex]:focus-visible{
  outline:2px solid var(--accent); outline-offset:3px;
}

.tabs{display:flex; flex-wrap:wrap; gap:6px; padding:14px 16px 0; background:var(--surface-2);}
/* Buttons and tabs are the house button: the monospace, in small capitals, as in every app */
.tab{
  font-family:var(--mono); font-size:12px; font-weight:400; letter-spacing:.08em; text-transform:uppercase; color:var(--muted);
  background:transparent; border:1px solid var(--line); border-radius:2px;
  padding:9px 13px; min-height:38px; cursor:pointer; white-space:nowrap;
}
.tab:hover{color:var(--cream); border-color:var(--cream);}
.tab[aria-pressed="true"]{color:var(--bg); background:var(--cream); border-color:var(--cream);}
@media (max-width:520px){ .tab{white-space:normal; text-align:left; line-height:1.35;} }
@media (pointer:coarse){ .tab{min-height:44px;} }

.btn{
  font-family:var(--mono); font-size:12px; font-weight:400; letter-spacing:.1em; text-transform:uppercase; color:var(--cream);
  background:transparent; border:1px solid var(--line); border-radius:2px;
  padding:10px 16px; min-height:40px; cursor:pointer; align-self:end; justify-self:start;
}
.btn:hover{background:var(--surface); border-color:var(--cream);}

.notation{
  font-family:var(--mono); font-size:13px; font-weight:500; color:var(--blue);
  border:1px solid rgba(36,85,143,.35); border-radius:2px; padding:4px 9px;
  display:inline-block; white-space:nowrap; letter-spacing:-.01em;
}
.notation.gold{color:var(--gold); border-color:rgba(168,125,8,.35);}

.readout{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(128px,1fr)); gap:14px 20px;
  padding:14px 16px; border-top:1px solid var(--line-soft);
}
.ro{display:flex; flex-direction:column; gap:1px; min-width:0;}
.ro-k{
  font-size:13px; letter-spacing:.08em; text-transform:uppercase; font-weight:600; color:var(--dim);
  display:flex; align-items:center; gap:6px;
}
.ro-k i{width:9px; height:9px; border-radius:1px; display:inline-block; flex:none;}
/* lower-case Greek inside a capitalised label stays lower case: λ, not Λ */
.lc{text-transform:none;}
.ro-v{font-family:var(--math); font-size:25px; line-height:1.25; font-variant-numeric:lining-nums tabular-nums; color:var(--cream);}
.ro-v.sm{font-size:19px;}

/* ---------- the player ---------- */
.player .stage-hold{position:relative; background:var(--surface);}
.player .stage-hold svg{display:block; width:100%; height:auto; max-width:100%;}
.caption-band{
  background:var(--surface); border-top:1px solid var(--line-soft);
  min-height:74px; display:flex; align-items:center; justify-content:center; padding:12px 22px 16px;
}
.caption{margin:0; text-align:center; color:var(--cream); font-size:15px; line-height:1.45; max-width:60ch;}
.caption.flash{animation:capIn .4s ease both;}
@keyframes capIn{from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none}}
.transport{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  background:var(--surface-2); border-top:1px solid var(--line-soft); padding:12px 16px;
}
.transport .v-play{min-width:74px;}
.transport .clock{font-size:13px; color:var(--dim); font-variant-numeric:lining-nums tabular-nums; letter-spacing:.03em;}
.transport .v-scrub{flex:1 1 180px; min-width:110px;}
.jump{
  color:var(--cream); font-size:13px; text-decoration:none;
  border-bottom:1px solid var(--accent); padding-bottom:1px; white-space:nowrap;
}
.jump:hover{border-bottom-width:2px; padding-bottom:0;}
.replay{position:absolute; inset:0; display:none; place-items:center; background:rgba(245,242,237,.8); cursor:pointer;}
.replay.on{display:grid;}
.replay span{
  font-family:var(--mono); font-size:12px; letter-spacing:.12em; text-transform:uppercase; color:var(--cream);
  border:1px solid var(--line); background:var(--surface); border-radius:2px; padding:10px 19px;
}

/* ---------- structure blocks ---------- */
.tax{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:22px;}
@media (max-width:640px){ .tax{grid-template-columns:1fr;} }
.tax-col{border:1px solid var(--line); border-radius:4px; padding:16px; background:var(--surface);}
.tax-col.gold{border-top:2px solid var(--gold);}
.tax-col.blue{border-top:2px solid var(--blue);}
.tax-col h3{font-family:var(--math); font-weight:500; font-size:21px; margin:0 0 2px;}
.tax-col p{font-size:15px; color:var(--muted); margin:0 0 14px;}
.tax-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:7px;}
.tax-list a{
  display:block; text-decoration:none; color:var(--cream); font-size:14px;
  border:1px solid var(--line-soft); border-left:2px solid var(--line);
  border-radius:2px; padding:8px 11px; background:var(--bg);
}
.tax-list a:hover{border-left-color:var(--accent); background:var(--surface-2);}
.tax-list a span{display:block; color:var(--dim); font-size:13px; line-height:1.45;}
.axis-note{
  margin-top:14px; border:1px dashed var(--line); border-radius:4px; padding:14px 16px;
  color:var(--muted); font-size:15px;
}
.axis-note b{color:var(--cream); font-weight:600;}

/* ---------- table ---------- */
.table-hold{overflow-x:auto; margin-top:20px; border:1px solid var(--line-soft); border-radius:4px;}
table{border-collapse:collapse; width:100%; min-width:640px; font-size:14px;}
th, td{text-align:left; padding:11px 14px; border-bottom:1px solid var(--line-soft); vertical-align:top;}
thead th{
  font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--dim);
  font-weight:600; background:var(--surface-2); white-space:nowrap;
}
tbody th{font-weight:500; color:var(--cream); white-space:nowrap; font-size:14.5px;}
td{color:var(--muted);}
tbody tr:last-child th, tbody tr:last-child td{border-bottom:none;}

/* ---------- glossary ---------- */
.gloss{
  margin:22px 0 0; padding:0;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:2px 28px;
}
.gloss div{padding:12px 0; border-top:1px solid var(--line-soft);}
.gloss dt{font-weight:600; font-size:15px; color:var(--cream); margin-bottom:3px;}
.gloss dd{margin:0; color:var(--muted); font-size:15px; line-height:1.55;}
.gloss code{font-family:var(--mono); font-size:13px; color:var(--cream);}

/* ---------- prerequisites / next ---------- */
.links{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:18px;}
@media (max-width:640px){ .links{grid-template-columns:1fr;} }
.links h3{font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); margin:0 0 8px;}
.links ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px;}
.links a{color:var(--cream); text-decoration:none; font-size:15px; border-bottom:1px solid var(--line);}
.links a:hover{border-bottom-color:var(--accent);}
.links .soon{color:var(--dim); font-size:15px;}
.links .soon::after{content:' · planned'; font-size:11.5px; letter-spacing:.08em; text-transform:uppercase;}

footer{
  margin-top:clamp(48px,6vw,76px); border-top:1px solid var(--line);
  padding-top:22px; color:var(--dim); font-size:13.5px; max-width:70ch;
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  .caption.flash{animation:none;}
}


/* ==========================================================================
   The Bench (AK.bench) — the level engine
   Three kinds of level share one layout: a rail of levels, a brief on the
   left, the stage on the right, and a result strip underneath.
   ========================================================================== */
.bn-rail{display:flex; gap:6px; overflow-x:auto; padding:12px 14px; background:var(--surface-2); border-bottom:1px solid var(--line-soft);}
.bn-tile{
  flex:0 0 auto; display:flex; flex-direction:column; gap:2px; align-items:flex-start; min-width:124px;
  font-family:var(--sans); color:var(--muted); background:transparent; border:1px solid var(--line); border-radius:2px;
  padding:7px 10px; cursor:pointer; text-align:left;
}
.bn-tile:hover{border-color:var(--dim); color:var(--cream);}
.bn-tile.cur{border-color:var(--cream); color:var(--cream); background:var(--surface);}
.bn-tile.done{border-color:rgba(47,107,79,.5);}
.bn-tile-n{font-size:11px; letter-spacing:.12em; color:var(--dim);}
.bn-tile-name{font-size:13px; font-weight:500; line-height:1.25; white-space:nowrap;}
.bn-tile-kind{font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim);}
.bn-tile-kind.puzzle{color:var(--blue);} .bn-tile-kind.build{color:var(--gold);} .bn-tile-kind.step{color:var(--teal);}
.bn-tile-star{font-size:11px; color:var(--green); letter-spacing:1px;}
.bn-page-sep{flex:0 0 auto; align-self:center; font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); padding:0 8px 0 4px; white-space:nowrap; border-left:1px solid var(--line); margin-left:6px;}

.bn-top{display:grid; grid-template-columns:minmax(250px,4fr) minmax(320px,8fr);}
@media (max-width:760px){ .bn-top{grid-template-columns:1fr;} }
.bn-brief{padding:16px; border-right:1px solid var(--line-soft); background:var(--bg); display:flex; flex-direction:column; gap:12px;}
@media (max-width:760px){ .bn-brief{border-right:none; border-bottom:1px solid var(--line-soft);} }
.bn-from{font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); font-weight:600; display:block;}
.bn-brief h3{font-family:var(--math); font-weight:500; font-size:23px; margin:2px 0 4px; line-height:1.15;}
.bn-brief p{margin:0; color:var(--muted); font-size:15px; line-height:1.5;}
.bn-brief p.bn-say{font-style:italic; color:var(--cream);}
.bn-scoring{border:1px dashed var(--line); border-radius:3px; padding:9px 11px; font-size:13.5px; color:var(--muted); line-height:1.45;}
.bn-scoring b{display:block; font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); margin-bottom:3px;}
.bn-crit{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px;}
.bn-c{display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-left-width:3px; border-radius:2px; padding:8px 10px; background:var(--surface);}
.bn-c.ok{border-left-color:var(--green);} .bn-c.bad{border-left-color:var(--red);}
.bn-c-body{display:flex; flex-direction:column; gap:2px; min-width:0; flex:1;}
.bn-c-text{font-size:13px; color:var(--cream); line-height:1.4;}
.bn-c-val{font-family:var(--math); font-size:14px; color:var(--muted); font-variant-numeric:lining-nums tabular-nums;}
.bn-c-st{font-size:15px; flex:none; width:16px; text-align:center; color:var(--dim);}
.bn-c.ok .bn-c-st{color:var(--green);} .bn-c.bad .bn-c-st{color:var(--red);}
.bn-needs{display:flex; flex-wrap:wrap; gap:6px; margin-top:auto; padding-top:6px;}
.bn-chip{font-size:11.5px; letter-spacing:.06em; text-transform:uppercase; border:1px solid var(--line); border-radius:2px; padding:3px 8px; color:var(--dim);}
.bn-chip.have{color:var(--green); border-color:rgba(47,107,79,.45);}
.bn-chip.earn{color:var(--gold); border-color:rgba(168,125,8,.45);}
.bn-chip a{color:inherit; text-decoration:none;} .bn-chip a:hover{text-decoration:underline;}

.bn-stage{display:flex; flex-direction:column; min-width:0;}
.bn-stage .fig{padding:14px 14px 6px;}
.bn-stage .controls{border-top:1px solid var(--line-soft);}
.bn-custom{padding:12px 16px 4px;}
.bn-actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center; padding:12px 16px; border-top:1px solid var(--line-soft); background:var(--surface-2);}
.bn-actions .btn.primary{background:var(--cream); color:var(--bg); border-color:var(--cream); font-weight:500;}
.bn-actions .btn.primary:hover{background:#2b5140; border-color:#2b5140;}
.bn-actions .btn[disabled]{opacity:.45; cursor:default;}
.bn-tries{font-size:13px; color:var(--dim); margin-left:auto; font-variant-numeric:lining-nums tabular-nums;}

.bn-result{padding:14px 16px; border-top:1px solid var(--line-soft); font-size:15px; color:var(--muted); line-height:1.55;}
.bn-result.ok{border-top-color:rgba(47,107,79,.35);} .bn-result.bad{border-top-color:rgba(168,68,58,.35);}
.bn-result b{font-weight:600; color:var(--cream);} .bn-result b i{font-style:normal; color:var(--line);}
.bn-result.ok b{color:var(--green);} .bn-result.bad b{color:var(--red);}
.bn-why{display:block; margin-top:8px; color:var(--cream); max-width:66ch;}
.bn-why::before{content:'Why'; display:block; font-size:11.5px; letter-spacing:.16em; text-transform:uppercase; color:var(--gold); margin-bottom:3px;}
.bn-unlock{display:inline-block; margin-top:10px; font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--gold); border:1px solid rgba(168,125,8,.5); border-radius:2px; padding:4px 9px;}
.bn-next{margin-top:10px;}
.bn-hist{border-top:1px solid var(--line-soft); padding:6px 14px 2px;}
.bn-hist .fig{padding:8px 0 0;}
.bn-hist-note{font-size:13px; color:var(--dim); padding:0 2px 10px;}

/* the sorter: cards, each with one or more rows of choices */
.bn-sort{display:flex; flex-direction:column; gap:8px;}
.bn-card{display:grid; grid-template-columns:minmax(120px,1fr) auto; gap:8px 16px; align-items:center; border:1px solid var(--line-soft); border-left:3px solid var(--line); border-radius:2px; padding:9px 12px; background:var(--surface);}
.bn-card.ok{border-left-color:var(--green);} .bn-card.bad{border-left-color:var(--red);}
.bn-card b{font-weight:500; font-size:14px; color:var(--cream);}
.bn-card small{display:block; color:var(--dim); font-size:13px; line-height:1.4;}
.bn-choices{display:flex; flex-direction:column; gap:5px; align-items:flex-end;}
.bn-choice{display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end;}
.bn-opt{font-family:var(--sans); font-size:13px; font-weight:500; color:var(--muted); background:transparent; border:1px solid var(--line); border-radius:2px; padding:4px 9px; cursor:pointer; white-space:nowrap;}
.bn-opt:hover{color:var(--cream); border-color:var(--dim);}
.bn-opt[aria-pressed="true"]{color:var(--bg); background:var(--cream); border-color:var(--cream);}
@media (max-width:560px){ .bn-card{grid-template-columns:1fr;} .bn-choices{align-items:flex-start;} .bn-choice{justify-content:flex-start;} }

/* the matcher: a fixed left column and slots filled from a pool */
.bn-match{display:grid; gap:6px 10px; align-items:stretch;}
.bn-match-h{font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); font-weight:600; padding-bottom:2px;}
.bn-m{font-family:var(--sans); font-size:13px; color:var(--cream); background:var(--surface); border:1px solid var(--line-soft); border-radius:2px; padding:8px 10px; text-align:left; cursor:pointer; min-height:40px; display:flex; align-items:center;}
.bn-m.fixed{cursor:default; border-left:3px solid var(--gold);}
.bn-m.pick{border-color:var(--cream); background:var(--surface-2);}
.bn-m.placed{border-left:3px solid var(--blue);}
.bn-m.ok{border-left-color:var(--green);} .bn-m.bad{border-left-color:var(--red);}
.bn-m.empty{color:var(--dim); border-style:dashed; justify-content:center;}
.bn-m:hover:not(.fixed){border-color:var(--dim);}
.bn-pool{display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; padding-top:10px; border-top:1px dashed var(--line);}
.bn-pool .bn-m{min-height:0; padding:6px 10px;}
.bn-pool-h{width:100%; font-size:11.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); font-weight:600;}

/* multiple choice */
.bn-mc{display:flex; flex-direction:column; gap:6px;}
.bn-mc-q{font-size:15px; color:var(--cream); margin:0 0 4px;}
.bn-mc .bn-opt{font-size:14px; padding:8px 12px; text-align:left; white-space:normal;}
.bn-mc-row{display:flex; gap:6px; flex-wrap:wrap;}

/* the campaign page and the map's play chip */
.bn-intro{max-width:66ch; color:var(--muted); margin-bottom:18px;}
