/* ==========================================================================
   ANTIHORIZN landing page, pipeline: the inside of the board stage and of the
   verification stage. Both show the same board on one WebGL canvas, built by
   assets/js/pipeline/board-model.js; the canvas sits in whichever of the two
   layers is on screen. assets/js/pipeline/board.js and verify.js add the
   readouts over it and set every opacity and transform from the clock;
   nothing here animates on its own.
   Everything is scoped under the two layers and sized from the layer
   (container units), so it holds from a 1280 x 720 window to 1920 x 1080.
     V1  The canvas
     V2  Board stage: the line that names the work, the readouts
     V3  Verification stage: the findings
     V4  Narrow layers
   ========================================================================== */

/* --- V1. The canvas ---------------------------------------------------------- */

/* The live canvas, and the still a layer keeps of its last picture so it can
   fade out complete after the canvas has gone to the other layer. */
.pl__layer > .plb__gl,
.pl__layer > .plb__still { position: absolute; inset: 0; pointer-events: none; }
.pl__layer > .plb__still[hidden] { display: none; }

/* While the camera is close the board runs past the edge of the layer; the
   picture fades out there instead of being cut, and it ends short of the
   line above it and the readouts under it. Nothing reaches the edges in a
   finished view. In the verification stage the picture ends where the
   findings begin. */
.pl__layer > .plb__gl,
.pl__layer > .plb__still {
  --fade-x: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
  --fade-y: linear-gradient(to bottom, transparent 2%, #000 10%, #000 83%, transparent 91%);
  -webkit-mask-image: var(--fade-x), var(--fade-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade-x), var(--fade-y);
  mask-composite: intersect;
}
/* verify.js moves --edge from the right of the layer to its middle as the
   camera leaves the view the board stage ended on. */
.pl__layer[data-stage="verify"] > .plb__gl,
.pl__layer[data-stage="verify"] > .plb__still {
  --fade-x: linear-gradient(to right, transparent 0, #000 7%, #000 calc(var(--edge, 53%) - 6%), transparent var(--edge, 53%));
  --fade-y: linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
}

/* Verification follows the board on the same canvas, from the same view. Its
   layer does not fade in over that: the picture carries on and the camera
   moves. verify.js sets data-cut for the moment of the hand-over only. */
.pl__layer[data-stage="verify"][data-cut="true"] { transition: none; }

.pl__layer[data-stage="board"] .plb,
.pl__layer[data-stage="verify"] .plv {
  position: absolute;
  inset: 0;
  container-type: size;
  color: var(--on-dark);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: left;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* --- V2. Board stage ----------------------------------------------------------- */

/* What is being done at this moment: the beat, the thing, a detail. */
.plb__now {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  white-space: nowrap;
  opacity: 0;
}
.plb__phase {
  min-width: 96px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pl-dimmer);
}
.plb__what { font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: -0.012em; color: var(--hot); }
.plb__detail { font-size: 14px; line-height: 1.2; letter-spacing: -0.006em; color: var(--pl-dim); }

/* The readouts: a rule and a row of figures under the board. A figure is
   the hot colour while it is the one moving; the script sets --heat. */
.plb__read {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  gap: clamp(18px, 3.4cqw, 36px);
  padding-top: 12px;
  border-top: 1px solid var(--pl-line);
}
.plb__cell { display: flex; flex-direction: column; gap: 7px; opacity: 0; }
.plb__lab {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--pl-dimmer);
}
.plb__val {
  font-family: var(--display);
  font-size: clamp(16px, 2.5cqh, 19px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--hot) calc(var(--heat, 0) * 100%), #A4A4AA);
}

/* --- V3. Verification stage ------------------------------------------------------ */

/* The board has the left half of the layer; the findings have the right. */
.plv__panel {
  --fs: clamp(12.5px, 1.86cqh, 14px);
  --pad: clamp(7px, 1.35cqh, 12px);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(46%, 440px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: var(--fs);
  line-height: 1.36;
  letter-spacing: -0.006em;
  opacity: 0;
}
.plv p { margin: 0; }
.plv ol { margin: 0; padding: 0; list-style: none; }
.plv b { font-weight: inherit; }

.plv__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--pad);
  border-bottom: 1px solid var(--pl-line);
}
.plv__lab {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pl-dimmer);
}
.plv__count { font-size: 12px; line-height: 1; color: var(--pl-dimmer); }
.plv__count b { color: var(--on-dark); font-weight: 600; }

.plv__row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: var(--pad) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--pl-line) 55%, transparent);
  opacity: 0;
}
/* The verdict. A pass is quiet; a check in hand, a warning and a fix are the
   accent, as on the reel. No green and no red on this ground. */
.plv__tag {
  margin-top: 0.08em;
  padding: 4px 0;
  border: 1px solid var(--pl-line);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  color: var(--pl-dim);
}
.plv__row[data-state="run"] .plv__tag { border-color: color-mix(in srgb, var(--hot) 45%, transparent); color: var(--hot); }
.plv__row[data-state="warn"] .plv__tag,
.plv__row[data-state="fix"] .plv__tag { border-color: var(--hot); background: var(--hot); color: var(--ink); }

.plv__texts { display: grid; }
.plv__text { grid-area: 1 / 1; color: var(--on-dark); text-wrap: balance; }
.plv__text--after { opacity: 0; }
.plv__rest { visibility: hidden; }
.plv__cite { margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--pl-dimmer); opacity: 0; }
/* What was done about the warning. It stays on the finding once it has passed. */
.plv__fix { margin-top: 5px; display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; line-height: 1.3; color: var(--pl-dim); opacity: 0; }
.plv__fix b {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hot);
}
.plv__fix .plv__rest { display: none; }

/* The closing line: the verdict on the board, and the rules behind it. */
.plv__done { padding-top: calc(var(--pad) + 4px); opacity: 0; }
.plv__all {
  font-family: var(--display);
  font-size: clamp(17px, 2.9cqh, 22px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.014em;
  color: color-mix(in srgb, var(--hot) calc(var(--heat, 0) * 100%), #A4A4AA);
}
.plv__rules { margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--pl-dim); }
.plv__rules b { color: var(--on-dark); font-weight: 600; }

/* --- V4. Narrow layers ----------------------------------------------------------- */

@container (max-width: 560px) {
  .plb__detail { display: none; }
  .plb__phase { min-width: 0; }
  .plb__read { gap: 14px; padding-top: 8px; }
  .plb__lab { font-size: 9.5px; }
  .plb__val { font-size: 13px; }
  .plb__cell { gap: 5px; }
}

/* On a narrow or a short layer there is no room for the list: one finding
   shows at a time, beside the board: the one in hand, then the closing line. */
@container (max-width: 560px) or (max-height: 530px) {
  .plv__panel { width: 47%; --fs: 11.5px; --pad: 0px; }
  .plv__head, .plv__cite, .plv__fix { display: none; }
  .plv__row { display: none; border: 0; grid-template-columns: minmax(0, 1fr); row-gap: 7px; justify-items: start; }
  .plv__row[data-cur="true"] { display: grid; }
  .plv__tag { margin: 0; padding: 3px 7px; font-size: 10px; }
  .plv__done { display: none; padding-top: 0; }
  .plv[data-closed="true"] .plv__row { display: none; }
  .plv[data-closed="true"] .plv__done { display: block; }
  .plv__all { font-size: 14px; }
  .plv__rules { font-size: 11px; }
}
