/* ==========================================================
   COUNFIELD — HOME: ONE RUN, MEASURED AT EIGHT CHECKPOINTS
   Loaded by the home page only. Inherits every token from style.css.

   The figure is complete without JavaScript (see profile-figure.mjs); what
   moves, moves for the reader who asked it to: a checkpoint is chosen by the
   reader, and the draw-on at the first view is inside
   prefers-reduced-motion: no-preference like all the other motion.
========================================================== */
.profile{
  --sci-grid:rgba(255,255,255,0.09);
  --sci-zero:rgba(255,255,255,0.28);
  --sci-panel:#141413;
  border-bottom:1px solid var(--line);
}
.profileIn{padding:clamp(72px,11vh,130px) var(--pad)}
.profile h2{
  font-family:var(--serif);font-weight:500;
  font-size:clamp(26px,3.2vw,40px);line-height:1.15;letter-spacing:-.01em;
  max-width:22ch;margin-bottom:var(--space-3);
}
.profileLede{color:var(--text-2);max-width:62ch;margin-bottom:var(--space-4)}
.profileFig{margin:0}

/* ---- the controls (shown by profile.js; a page without it has none) ---- */
.profileCtl{display:flex;align-items:flex-start;gap:var(--space-3);margin-bottom:var(--space-2)}
.profileCtl[hidden]{display:none}
.profilePlay{
  flex:none;min-width:76px;height:34px;padding:0 14px;
  border:1px solid var(--line);font-size:13px;font-weight:500;color:var(--text);
}
.profilePlay:hover,.profilePlay:focus-visible{border-color:var(--text-2)}
.profileTrack{flex:1;min-width:0}
/* The track stops half a column in from each side, so its eight stops fall on the
   centres of the eight labels under it. */
.profileRange{
  -webkit-appearance:none;appearance:none;display:block;
  width:calc(100% - 12.5%);margin:0 6.25%;height:30px;
  background:transparent;cursor:pointer;
}
.profileRange::-webkit-slider-runnable-track{height:1px;background:var(--text-2)}
.profileRange::-moz-range-track{height:1px;background:var(--text-2)}
.profileRange::-webkit-slider-thumb{
  -webkit-appearance:none;width:3px;height:22px;margin-top:-11px;
  background:var(--text);border:0;border-radius:0;
}
.profileRange::-moz-range-thumb{width:3px;height:22px;background:var(--text);border:0;border-radius:0}
.profileRange:focus-visible{outline:1px solid var(--text);outline-offset:6px}
.profileStops{
  list-style:none;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));
  font-size:12px;color:var(--text-2);text-align:center;margin-top:2px;
}
.profileStops li{cursor:pointer;padding:6px 0;font-variant-numeric:tabular-nums}
.profileStops li[aria-current="true"]{color:var(--text);font-weight:500}

.profileNow{
  font-size:14px;color:var(--text-2);margin-bottom:var(--space-3);
  font-variant-numeric:tabular-nums;
}
.profileNow b{color:var(--text);font-weight:600}

/* ---- the panels ---- */
.profileGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-2)}
.pp{background:var(--sci-panel);border:1px solid var(--line);padding:12px 12px 4px;min-width:0}
.pp-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:4px}
.pp-name{font-size:13px;font-weight:600;color:var(--text)}
button.pp-name{
  padding:8px 10px;margin:-8px -10px;text-align:left;cursor:pointer;
  background-image:linear-gradient(currentColor,currentColor);
  background-size:0% 1px;background-repeat:no-repeat;background-position:10px calc(100% - 7px);
}
button.pp-name:hover,button.pp-name:focus-visible{background-size:calc(100% - 20px) 1px}
button.pp-name[aria-pressed="true"]{background-size:calc(100% - 20px) 1px}
.pp-read{font-variant-numeric:tabular-nums;white-space:nowrap}
.pp-val{font-size:15px;color:var(--text)}
.pp-hits{font-size:11.5px;color:var(--text-2);margin-left:8px}
.pp-hits:empty{display:none}

.profile .sci-svg{display:block;width:100%;height:auto;overflow:visible}
.pp-svg{touch-action:pan-y}
.profileFig.is-live .pp-svg{cursor:crosshair}
.profile .sci-grid{stroke:var(--sci-grid);stroke-width:1}
.profile .sci-zero{stroke:var(--sci-zero)}
.profile .sci-line{fill:none;stroke:var(--text-2);stroke-width:1.4}
.profile .sci-dot{fill:var(--text);stroke:none}
.profile .sci-dot.sci-hollow{fill:var(--bg);stroke:var(--text-2);stroke-width:1.3}
.profile .sci-tick{fill:var(--text-2);font-size:10px;font-family:var(--sans)}
.pp-guide{stroke:var(--text-2);stroke-width:1;stroke-dasharray:2 3;opacity:.8;transform:translateX(calc(var(--dx,0) * 1px))}
.pp-cur{
  fill:none;stroke:var(--text);stroke-width:1.5;
  transform:translate(calc(var(--dx,0) * 1px),calc(var(--dy,0) * 1px));
}

/* one cell read on its own: the other charts step back. Only their marks do:
   a name and a value stay as legible as ever (dimming the text would take it
   below the contrast it needs). */
.profileFig[data-focus] .pp:not([data-on]) :is(.sci-line,.sci-dot,.sci-grid,.pp-cur,.pp-guide){opacity:.3}
.pp[data-on]{border-color:var(--text-2)}

.profileNote{margin-top:var(--space-3);max-width:72ch}
.profileNote p{color:var(--text);font-size:15px;line-height:1.7}
.profileNote p + p{margin-top:8px}
/* A cell being read: its note is a card that stays at the foot of the window while
   the figure is in view, so it is seen without the panels above it moving. */
.profileFig[data-focus] .profileNote{
  position:sticky;bottom:16px;z-index:5;max-width:none;
  background:var(--bg-2);border:1px solid var(--text-2);padding:16px 52px 16px 18px;
}
.pn-close{
  position:absolute;top:4px;right:6px;width:40px;height:40px;
  font-size:22px;line-height:1;color:var(--text-2);
}
.pn-close:hover,.pn-close:focus-visible{color:var(--text)}
.pn-close[hidden]{display:none}
.profileFig figcaption{
  font-size:13.5px;color:var(--text-2);line-height:1.65;max-width:74ch;
  margin-top:var(--space-2);border-left:2px solid var(--line);padding-left:12px;
}
.profileMore{margin-top:var(--space-4);font-size:15px;font-weight:500}

/* ---- the same numbers as text ---- */
.profileData{margin-top:var(--space-3)}
.profileData summary{cursor:pointer;font-size:14px;color:var(--text-2);padding:6px 0}
.profileData summary:hover,.profileData summary:focus-visible{color:var(--text)}
.profileFindings{margin:var(--space-2) 0 var(--space-3);padding-left:22px;max-width:68ch}
.profileFindings li{color:var(--text-2);font-size:14.5px;line-height:1.7;margin-bottom:8px}
.pscroll{overflow-x:auto}
.pscroll:focus-visible{outline-offset:-1px}
.ptable{border-collapse:collapse;width:100%;min-width:760px;font-size:13px;font-variant-numeric:tabular-nums}
.ptable caption{caption-side:top;text-align:left;color:var(--text-2);font-size:13px;padding-bottom:8px}
.ptable th,.ptable td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap;font-weight:400}
.ptable th:first-child,.ptable td:first-child{text-align:left}
.ptable thead th{color:var(--text-2);font-weight:500}
.ptable tbody th{color:var(--text);font-weight:500}
.pt-norm{color:var(--text-2);font-size:12px}

@media (max-width:900px){
  .profileGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pp:last-child{grid-column:1 / -1}
}
@media (max-width:560px){
  .profileGrid{gap:8px}
  .pp{padding:10px 8px 2px}
  .pp-xlab{display:none}
  .pp-hits{display:none}
  .profile .sci-tick:not(.pp-xlab){display:none}
  .profileFig[data-focus] .profileNote{padding:14px 46px 14px 14px}
  .profileCtl{gap:var(--space-2)}
}

/* ---- motion: only for readers who allow it ---- */
@media (prefers-reduced-motion: no-preference){
  .profilePlay{transition:border-color .2s}
  .pp{transition:border-color .3s ease}
  .pp :is(.sci-line,.sci-dot,.sci-grid){transition:opacity .4s ease}
  /* Both properties in one declaration: a rule that only set transition:opacity
     for these two (to dim them in focus mode, above) would replace this one's
     transition:transform wholesale wherever the two selectors tie on specificity,
     and the ring would jump instead of gliding between checkpoints. */
  .pp-cur,.pp-guide{transition:transform .55s var(--ease-out),opacity .4s ease}

  /* At the first view the panels draw one after another (the lines and dots
     themselves are drawn by the figure rules in style.css). */
  .pp:nth-child(2){--i:1}
  .pp:nth-child(3){--i:2}
  .pp:nth-child(4){--i:3}
  .pp:nth-child(5){--i:4}
  .pp:nth-child(6){--i:5}
  .pp:nth-child(7){--i:6}
  .pp:nth-child(8){--i:7}
  .pp:nth-child(9){--i:8}
  .profileFig[data-reveal].is-in .pp .sci-line{transition-delay:calc(.15s + var(--i,0) * .1s)}
  .profileFig[data-reveal].is-in .pp .sci-dot{transition-delay:calc(.5s + var(--i,0) * .1s)}
  .profileFig[data-reveal] .pp-cur{opacity:0}
  .profileFig[data-reveal].is-in .pp-cur{opacity:1;transition:opacity .6s ease 1.5s,transform .55s var(--ease-out)}
  .profileFig[data-reveal] .pp-guide{opacity:0}
  .profileFig[data-reveal].is-in .pp-guide{opacity:.8;transition:opacity .6s ease 1.5s,transform .55s var(--ease-out)}
}

@media print{
  .profile{--sci-grid:rgba(0,0,0,.12);--sci-zero:rgba(0,0,0,.4);--sci-panel:#f4f4f1}
  .profileCtl{display:none !important}
  .profileGrid,.pp{break-inside:avoid}
  .pp-cur,.pp-guide{display:none}
  /* Unlike research.css's .sci-scroll/.sci-table, these had no print override: the
     table's 760px min-width is wider than a printed page, so every column past
     "C@True" was being cut off instead of wrapped onto the page. */
  .pscroll{overflow:visible}
  .ptable{min-width:0;font-size:9pt}
}
