/*
 * The evidence.
 *
 * The film above is the machine's world — lacquer, gold, glow, everything engineered to
 * hold a gaze. This is the opposite material on purpose: warm stock, iron-gall ink, ruled
 * columns, a red reserved for correction marks. Falling out of the dark room onto a printed
 * page is the argument in one gesture. One of these surfaces wants your attention; the
 * other wants to be checked, and says so by looking like something that has been tabled.
 */

.appendix {
  position: relative;
  z-index: 20;
  color: var(--print);
  background-color: var(--stock);
  /* Laid stock: a faint fibre tooth and the ghost of a fold down the gutter. */
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 3px),
    radial-gradient(120% 60% at 50% 0%, rgba(120, 96, 54, 0.09), transparent 62%);
  background-size: 3px 100%, 100% 900px;
  box-shadow: 0 -30px 70px rgba(0, 0, 0, 0.85);
}

/* The tear line where the room ends and the paper begins. */
.appendix::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background:
    repeating-linear-gradient(90deg,
      var(--print-seal) 0 14px, transparent 14px 22px);
  opacity: 0.8;
}

.appendix__inner {
  max-width: 74rem;
  margin: 0 auto;
  padding: clamp(52px, 8vw, 96px) clamp(20px, 5vw, 64px) 96px;
}

/* -- masthead ------------------------------------------------------------- */
.appendix__head {
  padding-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 3px double var(--stock-rule);
}
.appendix__eyebrow {
  display: inline-block;
  padding: 4px 10px 3px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--stock);
  background: var(--print-seal);
}
.appendix__head h2 {
  margin-top: 20px;
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--print);
}
.appendix__lede {
  margin-top: 22px;
  max-width: 58ch;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.62;
  color: var(--print-soft);
  text-wrap: pretty;
}

/* -- sections ------------------------------------------------------------- */
/* Numbered like clauses in a report, with the number hung in the margin. */
.appendix__section {
  position: relative;
  margin-top: clamp(46px, 6vw, 76px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--stock-rule);
  counter-increment: appendix-section;
}
/* The masthead already closes with a double rule; a second line under it just looks like
   a mistake. */
.appendix__head + .appendix__section { border-top: 0; padding-top: 0; }
.appendix__section h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  letter-spacing: -0.015em;
  color: var(--print);
}
.appendix__section h3::before {
  content: counter(appendix-section, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--print-red);
}
.appendix__inner { counter-reset: appendix-section; }

.appendix__section > p {
  margin-top: 14px;
  max-width: 66ch;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--print-soft);
  text-wrap: pretty;
}
.appendix__section h4 {
  margin-top: 32px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--print-red);
}
.appendix__note {
  margin-top: 16px;
  max-width: 70ch;
  padding-left: 16px;
  border-left: 2px solid var(--stock-rule);
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--print-faint);
}
.appendix__note b { color: var(--print); font-variant-numeric: tabular-nums; }
.appendix__note em { font-style: italic; color: var(--print-soft); }

a { color: var(--print-red); }
.appendix a { color: var(--print-red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.appendix a:hover { color: var(--print-seal); }

/* -- headline figures ----------------------------------------------------- */
/* Ruled cells, not floating cards. */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 26px;
  border-top: 1px solid var(--stock-rule);
  border-left: 1px solid var(--stock-rule);
}
.kpis li {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 18px 20px;
  border-right: 1px solid var(--stock-rule);
  border-bottom: 1px solid var(--stock-rule);
}
.kpis b {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.15rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--print);
}
.kpis span {
  font-size: 0.8rem;
  line-height: 1.42;
  color: var(--print-faint);
}

/* -- tables --------------------------------------------------------------- */
.table-scroll {
  margin-top: 24px;
  overflow-x: auto;
  border-top: 2px solid var(--print);
  border-bottom: 2px solid var(--print);
}
.table-scroll:focus-visible { outline: 2px solid var(--print-red); outline-offset: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
caption {
  padding: 12px 2px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--print-faint);
}
thead th {
  position: sticky;
  top: 0;
  padding: 9px 12px;
  background: var(--stock);
  border-bottom: 1px solid var(--print);
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
  color: var(--print);
  white-space: nowrap;
}
thead th:first-child { text-align: left; }
tbody th {
  padding: 7px 12px;
  text-align: left;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--print);
  white-space: nowrap;
}
tbody td {
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--print-soft);
}
tbody td:last-child {
  font-family: var(--font-sans);
  text-align: left;
  color: var(--print-faint);
}
/* Ledger ruling rather than zebra fills. */
tbody tr { border-bottom: 1px solid var(--stock-rule-soft); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: rgba(168, 38, 26, 0.06); }
tbody tr.is-zero th, tbody tr.is-zero td { color: var(--print-faint); font-style: italic; }
tbody td b { color: var(--print); font-weight: 700; }
tbody td em { font-style: italic; font-size: 0.9em; color: var(--print-faint); }

code {
  padding: 1px 5px;
  background: var(--stock-shade);
  border: 1px solid var(--stock-rule);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--print);
}

/* -- sources -------------------------------------------------------------- */
.srcs { margin-top: 24px; counter-reset: src; border-top: 1px solid var(--stock-rule); }
.src {
  position: relative;
  padding: 16px 0 17px 46px;
  border-bottom: 1px solid var(--stock-rule-soft);
  counter-increment: src;
}
.src::before {
  content: counter(src, decimal-leading-zero);
  position: absolute;
  left: 0; top: 17px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--print-red);
}
.src__label {
  font-family: var(--font-display);
  font-size: 1.06rem;
  color: var(--print);
}
.src__pub {
  margin-top: 3px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--print-faint);
}
.src--official .src__pub::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 7px;
  vertical-align: 1px;
  background: var(--print-seal);
}
.src__detail {
  margin-top: 8px;
  max-width: 72ch;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--print-soft);
}

/* -- foot ----------------------------------------------------------------- */
.appendix__foot {
  margin-top: clamp(48px, 7vw, 84px);
  padding-top: 26px;
  border-top: 3px double var(--stock-rule);
}
.appendix__foot p {
  max-width: 62ch;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--print);
}
.appendix__foot a { font-weight: 600; }
.appendix__meta {
  margin-top: 14px !important;
  font-family: var(--font-sans) !important;
  font-size: 0.8rem !important;
  color: var(--print-faint) !important;
}

/* Shown only when the presentation could not start. */
.appendix__fallback {
  margin: 0;
  padding: 14px 24px;
  background: var(--print-seal);
  color: var(--stock);
  font-size: 0.88rem;
  text-align: center;
}
.film-failed { scroll-behavior: auto; }

@media (max-width: 640px) {
  thead th, tbody th, tbody td { padding: 6px 9px; font-size: 0.78rem; }
}
