:root {
  color-scheme: light;
  --ledger: #e7eef0;
  --paper: #f8faf9;
  --ink: #173139;
  --ink-soft: #4d6268;
  --line: #a9b9bd;
  --debt: #bd493d;
  --access: #176c76;
  --indictment: #705778;
  --report: #a37619;
  --analysis: #3f5961;
  --white: #ffffff;
  --display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --utility: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --max: 1480px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ledger);
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--ledger);
  background-image:
    linear-gradient(rgba(23, 49, 57, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 49, 57, 0.035) 1px, transparent 1px);
  background-size: 100% 36px, 72px 100%;
  font-family: var(--body);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.12rem);
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

a {
  color: currentColor;
  text-decoration-color: var(--access);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.18em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--report);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--white);
  font-family: var(--utility);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(100% - 2rem, var(--max));
  min-height: 66px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(23, 49, 57, 0.3);
  font-family: var(--utility);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.language-switcher a {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  border: 1px solid transparent;
}

.language-switcher a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--paper);
}

main {
  display: block;
}

.hero {
  width: min(100% - 2rem, var(--max));
  min-height: calc(100svh - 66px);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 6.5rem) 0 clamp(4rem, 8vw, 8rem);
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(640px, 1.3fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
}

.hero-copy {
  align-self: start;
  padding-top: clamp(0rem, 5vw, 5rem);
}

.kicker,
.eyebrow,
.figure-label,
.evidence-status {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.4rem, 7.4vw, 8.1rem);
  font-stretch: condensed;
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.82;
}

.deck {
  max-width: 36rem;
  margin: 2rem 0 0;
  font-size: clamp(1.15rem, 1rem + 0.55vw, 1.55rem);
  line-height: 1.48;
}

.scale-note {
  max-width: 32rem;
  margin-top: 2.5rem;
  padding: 1rem 1rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.9rem;
  border: 1px solid var(--report);
  background: rgba(248, 250, 249, 0.74);
  box-shadow: 5px 5px 0 rgba(163, 118, 25, 0.16);
  transform: rotate(-0.6deg);
}

.scale-value {
  grid-row: 1 / span 2;
  color: var(--report);
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.scale-label {
  align-self: center;
  font-family: var(--utility);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.scale-note p {
  grid-column: 1 / -1;
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.ledger {
  min-width: 0;
  margin: 0;
  padding: clamp(1.2rem, 2vw, 2rem);
  position: relative;
  border: 1px solid rgba(23, 49, 57, 0.48);
  background: var(--paper);
  box-shadow: 14px 18px 0 rgba(23, 49, 57, 0.1);
}

.ledger::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(23, 49, 57, 0.07) 1px, transparent 1px);
  background-size: 100% 58px;
  mix-blend-mode: multiply;
}

.ledger figcaption {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0.5rem 1.5rem;
  align-items: end;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}

.ledger figcaption .figure-label {
  grid-column: 1 / -1;
  margin: 0;
}

.ledger figcaption h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.ledger figcaption > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.42;
}

.ledger-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.8rem;
  font-family: var(--utility);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ledger-columns span {
  padding: 0.55rem 0.7rem;
}

.ledger-columns span:first-child {
  color: var(--debt);
  border-left: 3px solid var(--debt);
}

.ledger-columns span:last-child {
  color: var(--access);
  text-align: right;
  border-right: 3px solid var(--access);
}

.transactions {
  min-height: 640px;
  margin: 0.35rem 0 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(8, minmax(64px, auto));
  gap: 0.45rem 2.5rem;
  list-style: none;
}

.transactions::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: calc(50% - 3px);
  width: 6px;
  background: linear-gradient(to bottom, var(--debt) 0 42%, var(--access) 58% 100%);
}

.transaction {
  min-width: 0;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.6rem;
  align-self: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(23, 49, 57, 0.26);
  background: rgba(248, 250, 249, 0.96);
  transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
}

.transaction:nth-child(1) { grid-row: 1; }
.transaction:nth-child(2) { grid-row: 2; }
.transaction:nth-child(3) { grid-row: 3; }
.transaction:nth-child(4) { grid-row: 4; }
.transaction:nth-child(5) { grid-row: 5; }
.transaction:nth-child(6) { grid-row: 6; }
.transaction:nth-child(7) { grid-row: 7; }
.transaction:nth-child(8) { grid-row: 8; }

.side-debt {
  grid-column: 1;
  border-left: 3px solid var(--debt);
}

.side-access,
.side-loop {
  grid-column: 2;
  border-right: 3px solid var(--access);
}

.side-bridge {
  width: min(82%, 36rem);
  grid-column: 1 / -1;
  justify-self: center;
  border-top: 3px solid var(--indictment);
}

.side-loop {
  border-color: var(--indictment);
  box-shadow: 7px 7px 0 rgba(112, 87, 120, 0.12);
}

.side-loop::before {
  content: "";
  position: absolute;
  right: calc(100% + 0.2rem);
  bottom: 50%;
  width: 2rem;
  height: 5.2rem;
  border-left: 2px dashed var(--indictment);
  border-bottom: 2px dashed var(--indictment);
  border-radius: 0 0 0 1.25rem;
}

.entry-number {
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.5;
}

.entry-copy h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.entry-copy p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.38;
}

.stamps {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.stamp {
  padding: 0.15rem 0.32rem;
  border: 1px solid currentColor;
  font-family: var(--utility);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stamp-court { color: var(--access); }
.stamp-indictment { color: var(--indictment); }
.stamp-reporting { color: var(--report); }
.stamp-analysis { color: var(--analysis); border-style: dashed; }

.transaction.is-muted {
  opacity: 0.24;
  filter: grayscale(1);
}

.transaction:not(.is-muted):hover {
  transform: translateY(-2px);
}

.evidence-reader,
.loop-section,
.question-section,
.method-section {
  width: min(100% - 2rem, 1220px);
  margin-inline: auto;
}

.evidence-reader {
  padding: clamp(4rem, 8vw, 8rem) 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(480px, 1.28fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.section-heading h2,
.loop-copy h2,
.question-copy h2,
.method-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 5vw, 5.3rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.section-heading > p:last-child,
.loop-copy > p,
.question-copy > p,
.method-copy > p {
  max-width: 40rem;
}

.evidence-controls {
  grid-column: 1 / -1;
  display: none;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(23, 49, 57, 0.35);
  background: rgba(248, 250, 249, 0.74);
}

.js .evidence-controls {
  display: flex;
}

.evidence-button {
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-family: var(--utility);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.evidence-button:hover,
.evidence-button.is-active {
  color: var(--paper);
  background: var(--ink);
}

.evidence-panels {
  min-width: 0;
  display: grid;
  gap: 1rem;
}

.no-js .evidence-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.evidence-panel {
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2.2rem);
  border: 1px solid rgba(23, 49, 57, 0.34);
  background: var(--paper);
}

.js .evidence-panel[aria-hidden="true"] {
  display: none;
}

.evidence-panel h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.evidence-panel > p:last-child {
  max-width: 48rem;
  margin-bottom: 0;
}

.panel-court { border-top: 6px solid var(--access); }
.panel-indictment { border-top: 6px solid var(--indictment); }
.panel-reporting { border-top: 6px solid var(--report); }
.panel-analysis { border-top: 6px dashed var(--analysis); }

.loop-section {
  width: 100%;
  max-width: none;
  padding: clamp(4rem, 8vw, 8rem) max(1rem, calc((100% - 1220px) / 2));
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  color: var(--paper);
  background: var(--ink);
}

.loop-section .eyebrow,
.loop-section .limit-note {
  color: #b8c8cb;
}

.limit-note {
  padding-left: 1rem;
  border-left: 3px solid currentColor;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.return-loop {
  min-height: 410px;
  position: relative;
  display: grid;
  grid-template-rows: 1fr 110px 1fr;
  align-items: center;
}

.date-entry {
  width: min(78%, 31rem);
  padding: 1.2rem 1.35rem;
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(248, 250, 249, 0.48);
  background: rgba(248, 250, 249, 0.07);
}

.date-entry time {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.date-entry span {
  color: #c3d0d2;
  font-family: var(--utility);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.date-exit {
  justify-self: start;
  border-left: 6px solid var(--debt);
}

.date-return {
  justify-self: end;
  border-right: 6px solid var(--access);
}

.loop-line {
  width: 74%;
  height: 100%;
  justify-self: center;
  position: relative;
  border-right: 3px dashed var(--indictment);
  border-bottom: 3px dashed var(--indictment);
  border-radius: 0 0 4rem 0;
}

.loop-line::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 13px;
  height: 13px;
  border-top: 3px solid var(--indictment);
  border-right: 3px solid var(--indictment);
  transform: rotate(45deg);
}

.question-section,
.method-section {
  padding: clamp(4.5rem, 9vw, 9rem) 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(3rem, 8vw, 8rem);
}

.question-section {
  align-items: start;
}

.unknown-box,
.sources-box {
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border: 1px solid rgba(23, 49, 57, 0.35);
  background: rgba(248, 250, 249, 0.82);
}

.unknown-box h3,
.sources-box h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.unknown-box ul {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  font-family: var(--utility);
  font-size: 0.78rem;
}

.unknown-box li {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid rgba(23, 49, 57, 0.24);
}

.unknown-box li::before {
  content: "?";
  display: inline-block;
  width: 1.8rem;
  color: var(--report);
  font-weight: 800;
}

.method-section {
  border-top: 1px solid rgba(23, 49, 57, 0.3);
}

.correction-note {
  margin-top: 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--indictment);
  background: rgba(112, 87, 120, 0.08);
  font-family: var(--utility);
  font-size: 0.78rem;
  line-height: 1.5;
}

.sources-box ol {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
}

.sources-box li {
  margin: 0.85rem 0;
  padding-left: 0.35rem;
}

.sources-box a {
  overflow-wrap: anywhere;
}

.sources-box > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: 0.72rem;
  line-height: 1.5;
}

.site-footer {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  padding: 2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 2px solid var(--ink);
  font-family: var(--utility);
  font-size: 0.72rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
}

.site-footer p {
  margin: 0;
}

.not-found {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

.not-found main {
  width: min(100% - 2rem, 42rem);
  padding: 3rem;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.not-found h1 {
  font-size: clamp(3.2rem, 10vw, 7rem);
}

.return-link {
  min-height: 48px;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  display: inline-grid;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--utility);
}

@media (max-width: 1060px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 0;
  }

  h1 {
    max-width: 12ch;
  }

  .ledger {
    width: min(100%, 860px);
    justify-self: center;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 100% 32px, 48px 100%;
  }

  .site-header,
  .hero,
  .evidence-reader,
  .question-section,
  .method-section,
  .site-footer {
    width: min(100% - 1.25rem, var(--max));
  }

  .site-header {
    min-height: 60px;
  }

  .brand {
    font-size: 0.68rem;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
    gap: 3.25rem;
  }

  h1 {
    font-size: clamp(4rem, 19vw, 5.8rem);
  }

  .deck {
    font-size: 1.12rem;
  }

  .scale-note {
    grid-template-columns: 1fr;
  }

  .scale-value {
    grid-row: auto;
  }

  .ledger {
    padding: 1rem 0.8rem;
    box-shadow: 7px 9px 0 rgba(23, 49, 57, 0.1);
  }

  .ledger figcaption {
    grid-template-columns: 1fr;
  }

  .ledger figcaption .figure-label {
    grid-column: auto;
  }

  .ledger-columns {
    grid-template-columns: 1fr;
  }

  .ledger-columns span {
    text-align: left !important;
    border: 0 !important;
  }

  .ledger-columns span:last-child::before {
    content: "/ ";
  }

  .transactions {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 0.75rem;
    padding-left: 1.65rem;
  }

  .transactions::before {
    left: 0.55rem;
    width: 4px;
  }

  .transaction,
  .transaction:nth-child(n),
  .side-debt,
  .side-access,
  .side-bridge,
  .side-loop {
    width: 100%;
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .side-loop::before {
    display: none;
  }

  .entry-copy h3 {
    font-size: 1.2rem;
  }

  .entry-copy p {
    font-size: 0.84rem;
  }

  .evidence-reader,
  .question-section,
  .method-section,
  .loop-section {
    grid-template-columns: 1fr;
  }

  .no-js .evidence-panels {
    grid-template-columns: 1fr;
  }

  .evidence-controls {
    gap: 0.45rem;
  }

  .evidence-button {
    flex: 1 1 9rem;
  }

  .loop-section {
    padding-inline: 1rem;
  }

  .return-loop {
    min-height: 360px;
  }

  .date-entry {
    width: 90%;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .evidence-controls,
  .site-footer {
    display: none !important;
  }

  body {
    background: white;
  }

  .hero,
  .evidence-reader,
  .loop-section,
  .question-section,
  .method-section {
    width: 100%;
    min-height: 0;
    display: block;
    color: black;
    background: white;
  }

  .transaction.is-muted,
  .js .evidence-panel[aria-hidden="true"] {
    display: block;
    opacity: 1;
    filter: none;
  }
}
