/* Capabilities: the evidence board (Fig. 02), its controls, and the same evidence as a table. */

/* ---- first screen. The board is large, so this page takes the whole first screen. */
.page-capabilities .hero--page { --sh: var(--shot-h, 100svh); min-height: var(--shot-h, max(700px, 100svh)); }   /* --sh: the screen's height, or the one a full-page picture asks for */
.page-capabilities .hero__copy { align-self: start; max-width: 664px; padding-top: calc(var(--bar) + clamp(30px, calc(var(--sh) * .086 + max(0px, (var(--sh) - 900px) * .3)), 190px)); padding-bottom: 34px; }
.page-capabilities .hero__copy .lede { max-width: 41ch; margin-bottom: clamp(20px, 3.2vh, 32px); }
.page-capabilities .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* a status: its word and the form its pin takes on the board */
.ev-st { display: inline-flex; align-items: center; gap: 9px; font: 500 10.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg); white-space: nowrap; }
.ev-st::before { content: ""; flex: none; box-sizing: border-box; width: 11px; height: 11px; border-radius: 50%; }
.ev-st--live::before { background: currentColor; }
.ev-st--built::before { border: 2px solid currentColor; }
.ev-st--testing::before { background: repeating-conic-gradient(from -18deg, currentColor 0 36deg, transparent 0 60deg); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); }
.ev-st--proto::before { width: 7px; height: 7px; margin: 0 2px; border: 1.5px solid currentColor; }

/* the controls: capabilities (the rows) beside the headline, the work (the columns) under the board */
.ev-rows, .ev-note { max-width: clamp(488px, 34vw, 540px); }
.ev-rows .mono, .ev-foot .mono { margin: 0 0 9px; }
.ev-list, .ev-across, .ev-key { margin: 0; padding: 0; list-style: none; }
.ev-list { display: grid; grid-template-rows: repeat(6, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 28px; }
.ev-list li { border-bottom: 1px solid var(--line); }
.ev-list li:nth-child(6n + 1) { border-top: 1px solid var(--line); }
.ev-list button, .ev-across button { width: 100%; background: none; border: 0; border-radius: 0; color: var(--fg-2); font: 400 13.5px/1.35 var(--sans); text-align: left; cursor: pointer; transition: color .2s; }
.ev-list button { display: flex; align-items: baseline; gap: 12px; min-height: 29px; padding: 5px 4px 5px 0; }
.ev-list button b, .ev-across button b { flex: none; min-width: 20px; font: 500 10.5px/1.6 var(--mono); letter-spacing: .1em; color: var(--fg-3); transition: color .2s; }
.ev-list button:hover, .ev-list button.is-on, .ev-list button[aria-pressed="true"],
.ev-across button:hover, .ev-across button.is-on, .ev-across button[aria-pressed="true"] { color: var(--fg); }
.ev-list button:hover b, .ev-list button.is-on b, .ev-list button[aria-pressed="true"] b,
.ev-across button:hover b, .ev-across button.is-on b, .ev-across button[aria-pressed="true"] b { color: var(--signal); }
.ev-list button.is-off, .ev-across button.is-off { color: var(--fg-3); }
.ev-list button:focus-visible, .ev-across button:focus-visible { outline-offset: 1px; }

/* under the board: what the pins mean, and the four places a capability can be shown */
.ev-foot { position: absolute; right: var(--gutter); bottom: max(34px, calc((var(--sh) - 980px) * .38)); width: min(600px, 44vw); }   /* on a tall screen it stays near the board */
.hero > .ev-foot { animation: phl-fade .9s ease .35s both; }
.ev-status .mono { display: none; }
.ev-key { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 18px; }
.ev-key li { display: flex; }
.ev-key .ev-st { color: var(--fg-2); }
.ev-across { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ev-across li + li { border-left: 1px solid var(--line); }
.ev-across button { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline; padding: 9px 6px 10px 14px; }
.ev-across li:first-child button { padding-left: 0; }
.ev-across button b { grid-row: 1 / 3; min-width: 0; }
.ev-across button i { grid-column: 2; font: 500 10px/1.6 var(--mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
@media (min-width: 1600px) {                               /* room for both side by side, the work under its columns */
  .ev-foot { width: auto; display: grid; grid-template-columns: auto 528px; column-gap: clamp(36px, 4.6vw, 84px); align-items: start; }
  .ev-status .mono { display: block; }
  .ev-key { display: grid; grid-template-columns: auto auto; gap: 9px 30px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
}

/* the note: what is selected, where it is shown, and its status. Its height is fixed so nothing moves when it changes. */
.ev-note { height: 16em; margin-top: clamp(16px, 2.4vh, 24px); font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.ev-note p { margin: 0; }
.ev-note a { color: var(--fg); text-decoration: none; box-shadow: inset 0 -1px 0 var(--line-2); white-space: nowrap; transition: box-shadow .2s; }
.ev-note a:hover { box-shadow: inset 0 -1px 0 var(--signal); }
.ev-note__lead b { margin-right: 7px; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; color: var(--signal); }
.ev-note__lead strong { font-weight: 600; color: var(--fg); }
.ev-note__list { margin: 9px 0 0; padding: 0; list-style: none; }
.ev-note__list li { display: grid; grid-template-columns: 10.4em minmax(0, 1fr); column-gap: 14px; align-items: baseline; padding: 6px 0 7px; border-top: 1px solid var(--line); }
.ev-note__list a { justify-self: start; }
.ev-note__more { grid-column: 1 / -1; margin-top: 2px; font-size: 13px; }
.ev-note__list--caps li { grid-template-columns: 11.4em minmax(0, 1fr); }
@media (max-height: 859px) and (min-width: 861px) {       /* a short screen: the one-line notes stay in the table below */
  .ev-note { height: 10.6em; }
  .ev-note__more { display: none; }
}
@media (max-height: 780px) and (min-width: 861px) {
  .page-capabilities .hero__copy { padding-top: calc(var(--bar) + 26px); padding-bottom: 26px; }
  .ev-list button { min-height: 26px; padding: 3px 4px 4px 0; }
}

/* where the figure cannot run, or scripts are off, the controls have nothing to drive: the table below says it all */
.no-webgl .ev-rows, .no-webgl .ev-note, .no-webgl .ev-cols { display: none; }
@media (scripting: none) { .ev-rows, .ev-note, .ev-cols { display: none; } }
.bare .ev-foot { visibility: hidden; }

/* ---- the evidence, as a table */
.ev-defs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 clamp(32px, 4.4vw, 64px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ev-defs > div { padding: 16px 20px 18px 0; }
.ev-defs > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.ev-defs dt { margin: 0 0 6px; }
.ev-defs dd { margin: 0; font-size: 14.5px; color: var(--fg-2); }

.ev-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ev-table th, .ev-table td { padding: 22px 24px 26px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; }
.ev-table th:first-child { width: 31%; padding-left: 0; border-left: 0; }
.ev-table tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
.ev-table thead th { position: sticky; top: var(--bar); z-index: 1; padding-top: 16px; padding-bottom: 16px; border-top: 0; background: var(--ink-0); box-shadow: inset 0 -1px 0 var(--line-2); vertical-align: bottom; }
.ev-table__no { display: block; margin-bottom: 9px; font: 500 11px/1.5 var(--mono); letter-spacing: .1em; color: var(--fg-3); }
.ev-table__head { display: inline-block; font: 700 18px/1.2 var(--sans); letter-spacing: -.014em; color: var(--fg); text-decoration: none; }
a.ev-table__head:hover { box-shadow: inset 0 -1px 0 var(--signal); }
.ev-table__sub { display: block; margin-top: 4px; font: 500 10.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.ev-table__name { display: block; font: 700 clamp(18px, 1.5vw, 22px)/1.2 var(--sans); letter-spacing: -.016em; color: var(--fg); }
.ev-table__line { display: block; margin-top: 9px; max-width: 38ch; font-size: 14.5px; line-height: 1.5; color: var(--fg-2); }
.ev-table__note { display: block; margin-top: 10px; max-width: 30ch; font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.ev-table tr[id] { scroll-margin-top: calc(var(--bar) + 104px); }
.ev-table tr:target .ev-table__no { color: var(--signal); }

/* ---- what we take on */
.ev-take { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ev-take li { padding: 28px 28px 8px 0; }
.ev-take li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.ev-take h3 { margin: 18px 0 12px; font: 700 21px/1.15 var(--sans); letter-spacing: -.015em; }
.ev-take p { margin: 0; max-width: 36ch; font-size: 15px; color: var(--fg-2); }
.ev-take .ev-take__ref { margin-top: 18px; font: 500 10.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.ev-take__ref a { margin-left: 10px; color: var(--fg-2); text-decoration: none; box-shadow: inset 0 -1px 0 var(--line-2); }
.ev-take__ref a:hover { color: var(--fg); box-shadow: inset 0 -1px 0 var(--signal); }

@media (max-width: 1180px) {
  .ev-take { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-take li { padding-bottom: 30px; }
  .ev-take li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .ev-take li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---- narrow screens: label, headline, a line of text, the board, then its key, the note and the controls */
@media (max-width: 860px) {
  .page-capabilities .hero--page { min-height: 0; }
  .page-capabilities .hero__copy .lede { order: 2; max-width: none; margin-top: 14px; margin-bottom: 12px; }
  .ev-foot { display: contents; }
  .ev-status, .ev-cols { animation: phl-fade .9s ease .35s both; }
  .ev-status { order: 4; margin: 14px var(--gutter) 0; }
  .ev-key { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 7px 28px; margin: 0; }
  .ev-note { order: 5; max-width: none; height: auto; min-height: 12.4em; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
  .ev-rows { order: 6; max-width: none; margin-top: 22px; }
  .ev-cols { order: 7; margin: 22px var(--gutter) 36px; }
  .ev-list { column-gap: 16px; }
  .ev-list button { min-height: 46px; align-items: center; padding: 6px 2px 6px 0; line-height: 1.25; }
  .ev-across { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-across li + li { border-left: 0; }
  .ev-across li:nth-child(even) { border-left: 1px solid var(--line); }
  .ev-across li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ev-across button, .ev-across li:first-child button { min-height: 52px; padding: 8px 6px 9px 0; }
  .ev-across li:nth-child(even) button { padding-left: 14px; }
  .ev-note__more { display: none; }

  .ev-defs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-defs > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .ev-defs > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ev-defs > div { padding: 14px 12px 16px 0; }
  .ev-defs > div + div { padding-left: 16px; }

  /* the table becomes one block per capability; every piece of work keeps its line, shown or not */
  .ev-table, .ev-table tbody, .ev-table tr, .ev-table th, .ev-table td { display: block; }
  .ev-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ev-table tbody tr { padding: 24px 0 6px; border-top: 1px solid var(--line-2); }
  .ev-table tbody tr:last-child { border-bottom: 1px solid var(--line-2); }
  .ev-table tbody th, .ev-table th:first-child { width: auto; padding: 0 0 16px; border: 0; }
  .ev-table tbody tr:last-child > * { border-bottom: 0; }
  .ev-table td { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding: 11px 0 12px; border-left: 0; }
  .ev-table td::before { content: attr(data-label); font: 500 10.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); }
  .ev-table td .ev-st { justify-self: end; }
  .ev-table td .ev-table__note { grid-column: 1 / -1; max-width: none; margin-top: 2px; }
  .ev-table td.is-empty { padding: 9px 0 10px; }
  .ev-table td.is-empty::before { color: var(--fg-3); }
  .ev-table__line { max-width: none; }
  .ev-table tr[id] { scroll-margin-top: calc(var(--bar) + 12px); }

  .ev-take { grid-template-columns: 1fr; }
  .ev-take li, .ev-take li + li { padding: 24px 0 26px; border-left: 0; }
  .ev-take li + li { border-top: 1px solid var(--line); }
  .ev-take p { max-width: none; }
}
/* tall narrow screens: the board stays in view while its controls scroll under it */
@media (max-width: 860px) and (min-height: 620px) {
  .page-capabilities .fig { position: sticky; top: var(--bar); z-index: 2; }
  .ev-list button, .ev-across button, .ev-note a { scroll-margin-top: calc(var(--bar) + max(46svh, 300px) + 12px); }   /* focus never lands under the board */
}
