/* Aktuari data surfaces: published numbers, the chart plate, tables, definitions and receipts. Tokens: base.css. */

/* Published numbers: tabular figures, each a link to its source. */
.num,
table,
.km,
.readout,
.steps {
  font-variant-numeric: tabular-nums lining-nums;
}
.num {
  text-decoration: underline dotted 1px;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 0.2em;
  white-space: nowrap;
  font-weight: 600;
}
.num:hover {
  text-decoration-style: solid;
  text-decoration-color: var(--active);
}

/* The plate: figure with caption above, chart, and a reading line. */
.plate {
  margin: 0 0 1.8rem;
  border-top: 1px solid var(--ink);
  padding-top: 0.6rem;
  max-width: var(--wide);
}
.plate figcaption,
caption,
.caption,
.ledger th[scope="col"],
.life th[scope="col"],
.defs dt {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.plate figcaption {
  font-size: 1.05rem;
}
.plate-art {
  margin-top: 0.4rem;
}
.km {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}
.km-narrow {
  display: none;
}
@media (max-width: 560px) {
  .km-wide {
    display: none;
  }
  .km-narrow {
    display: block;
  }
}
.km-grid {
  stroke: var(--rule);
  stroke-width: 1;
}
.km-axis {
  stroke: var(--ink-3);
  stroke-width: 1;
}
.km-tick,
.km-axis-title,
.km-note {
  fill: var(--ink-3);
}
.km-note {
  font-style: italic;
}
.km-band {
  fill: var(--band);
}
.km-line {
  fill: none;
  stroke: var(--active);
  stroke-width: 2;
  stroke-linejoin: round;
}
.km-guide {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.km-mark {
  fill: var(--active);
  stroke: var(--paper);
  stroke-width: 2;
}
.km-label {
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.km-cross {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.km-cross-dot {
  fill: var(--paper);
  stroke: var(--active);
  stroke-width: 2;
}
.km-hit {
  fill: transparent;
  pointer-events: all;
  cursor: crosshair;
}
.readout {
  margin: 0.3rem 0 0;
  min-height: 1.6em;
  font-size: 0.92rem;
  color: var(--ink-2);
}

@media (prefers-reduced-motion: no-preference) {
  .plate-art .km-line,
  .plate-art .km-band {
    animation: reveal 1.1s var(--ease-out) both;
  }
}
@keyframes reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Tables: heavy rule on top, hairlines between rows, figures right-aligned. */
table {
  border-collapse: collapse;
  width: 100%;
}
caption,
.caption {
  caption-side: bottom;
  text-align: left;
  padding-top: 0.5rem;
  font-size: 0.88rem;
  font-variant-caps: normal;
  letter-spacing: 0;
  font-style: italic;
}
th,
td {
  padding: 0.42rem 0.75rem 0.42rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: baseline;
}
thead th {
  border-bottom: 1px solid var(--ink);
  font-weight: 600;
}
.page > .life {
  max-width: 40rem;
  border-top: 2px solid var(--ink);
}
.life td,
.life th[scope="row"] {
  text-align: right;
}
.life th[scope="row"] {
  font-weight: 400;
  padding-right: 1.5rem;
}
.life thead th {
  text-align: right;
}
.life td {
  white-space: nowrap;
}
@media (max-width: 560px) {
  .life {
    font-size: 0.9rem;
  }
  .life th,
  .life td {
    padding-right: 0.5rem;
  }
  .life th[scope="row"] {
    padding-right: 0.9rem;
  }
}

.pair {
  display: grid;
  gap: 0 3rem;
}
@media (min-width: 900px) {
  .pair {
    grid-template-columns: 1fr 1fr;
  }
}
.steps {
  padding-left: 1.4rem;
  margin: 0;
}
.steps li {
  padding: 0.15rem 0 0.35rem 0.3rem;
}
.steps li::marker {
  font-weight: 600;
  color: var(--ink-2);
}

/* Method */
.defs {
  margin: 0;
  border-top: 2px solid var(--ink);
}
.defs div {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.defs dt {
  font-size: 1.05rem;
}
.defs dd {
  margin: 0;
}
@media (max-width: 520px) {
  .defs div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
}
.prose h2 {
  font-size: 1.2rem;
}
.prose p {
  margin: 0 0 1rem;
}

.ledger {
  max-width: 34rem;
  border-top: 2px solid var(--ink);
}
.ledger th[scope="row"] {
  font-weight: 400;
}
.ledger td {
  text-align: right;
}

/* Receipts */
.scroll {
  overflow-x: auto;
  max-width: var(--wide);
}
.scroll:focus-visible {
  outline-offset: 2px;
}
.calls {
  max-width: none;
  min-width: 52rem;
  font-size: 0.9rem;
}
.calls td {
  text-align: left;
}
.calls .time,
.calls .sha {
  white-space: nowrap;
}
.calls .params code {
  font-size: 0.78rem;
  color: var(--ink-2);
}
@media (max-width: 700px) {
  .calls {
    min-width: 0;
  }
  .calls thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .calls tr {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .calls td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.12rem 0;
    border: 0;
  }
  .calls td::before {
    content: attr(data-label);
    font-variant-caps: all-small-caps;
    letter-spacing: 0.05em;
    color: var(--ink-2);
  }
}
.http .dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.4em;
  vertical-align: 0.05em;
  background: var(--active);
}
.http.refused .dot {
  background: var(--inactive);
}
.used {
  font-style: italic;
  color: var(--ink-2);
  margin-left: 0.4em;
}

.colophon {
  border-top: 3px double var(--ink);
  width: calc(100% - 2 * var(--gutter));
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 0 2rem;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.colophon p {
  max-width: var(--wide);
  margin: 0 auto 0.3rem;
}
.snapshot {
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
