@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-wght-5.2.9.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Navy and brass come from the app. Brass is reserved for sources and citations. */
:root {
  --night: #0f2230;
  --brass: #dcc38b;
  --answer: #f2e3b8;
  --moon: #e9eef0;
  --mist: #a7b6c2;
  --paper: #f1f3ef;
  --paper-2: #e5e9e4;
  --ink: #13232f;
  --slate: #53616b;
  --rule: #cfd6d1;
  --rule-night: rgba(167, 182, 194, 0.28);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 20px;
}

@media (min-width: 700px) {
  :root {
    --gutter: 40px;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  background: var(--moon);
  color: var(--night);
  padding: 10px 14px;
  font: 600 0.875rem var(--sans);
}

.skip:focus {
  top: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 1.0625rem/1 var(--serif);
}

/* Header and hero share the night background. */
.site-header,
.hero {
  background: var(--night);
  color: var(--moon);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.site-header nav {
  display: flex;
  gap: 24px;
  font: 500 0.875rem/1 var(--sans);
}

.site-header nav a {
  color: var(--mist);
  text-decoration: none;
  padding-block: 10px;
}

.site-header nav a:hover {
  color: var(--moon);
}

.hero {
  padding-bottom: 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "field" "controls" "status";
  row-gap: 20px;
}

.hero-copy {
  grid-area: copy;
  padding-top: 28px;
}

h1 {
  font: 500 clamp(2.75rem, 1.4rem + 6vw, 5.75rem) / 0.98 var(--serif);
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  max-width: 9.5em;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.4;
  margin: 0 0 16px;
  max-width: 26em;
}

.hero-text {
  color: var(--mist);
  margin: 0;
  max-width: 32em;
}

/* The library field: static SVG first, WebGL canvas fades in over it when available. */
.field {
  grid-area: field;
  position: relative;
  height: clamp(320px, 92vw, 480px);
  margin-inline: calc(var(--gutter) * -1);
}

.field > svg,
.field > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.field > canvas {
  opacity: 0;
  transition: opacity 0.9s ease;
}

.field.is-live > canvas {
  opacity: 1;
}

.field-static {
  transition: opacity 0.9s ease;
}

.field.is-live > .field-static {
  opacity: 0;
}

.field-static circle {
  fill: #9fb4c7;
}

.field-static .empty {
  fill: none;
  stroke: #6f8394;
  stroke-width: 1.2;
}

.field-static .source {
  fill: var(--brass);
}

.field-static .uncited {
  opacity: 0.5;
}

.field-static .answer {
  fill: var(--answer);
}

.field-static line {
  stroke: var(--brass);
  stroke-width: 1;
  opacity: 0.65;
}

.field-static text {
  font: 400 13px var(--serif);
  fill: var(--mist);
  text-anchor: middle;
}

.field-static .cite {
  fill: var(--brass);
}

.field-static .answer-label {
  fill: var(--answer);
}

.field-static .jurisdiction,
.field-static .citations {
  transition: opacity 0.35s ease;
}

.field-static .citations {
  opacity: 0;
}

.field-static[data-active="0"] .citations[data-j="0"],
.field-static[data-active="1"] .citations[data-j="1"],
.field-static[data-active="2"] .citations[data-j="2"],
.field-static[data-active="3"] .citations[data-j="3"] {
  opacity: 1;
}

.field-static[data-active="0"] .jurisdiction:not([data-j="0"]),
.field-static[data-active="1"] .jurisdiction:not([data-j="1"]),
.field-static[data-active="2"] .jurisdiction:not([data-j="2"]),
.field-static[data-active="3"] .jurisdiction:not([data-j="3"]) {
  opacity: 0.4;
}

.field-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.field:not(.is-live) .field-labels {
  display: none;
}

.field-label {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  white-space: nowrap;
  font: 400 0.8125rem/1 var(--serif);
  color: var(--mist);
  will-change: transform, opacity;
}

.field-name {
  translate: -50% -50%;
}

.field-cite {
  translate: -50% -170%;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.field-answer {
  translate: -50% -210%;
  color: var(--answer);
}

.field-controls {
  grid-area: controls;
}

.controls-title {
  font: 500 0.875rem/1.4 var(--sans);
  color: var(--mist);
  margin: 0 0 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  font: 500 0.875rem/1 var(--sans);
  color: var(--moon);
  background: transparent;
  border: 1px solid var(--rule-night);
  border-radius: 6px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--mist);
}

.chip[aria-pressed="true"] {
  background: var(--moon);
  border-color: var(--moon);
  color: var(--night);
}

.caption {
  color: var(--mist);
  font-size: 1rem;
  line-height: 1.55;
  margin: 16px 0 0;
  min-height: 4.65em;
  max-width: 32em;
}

.status {
  grid-area: status;
  font: 400 0.875rem/1.5 var(--sans);
  color: var(--mist);
  margin: 4px 0 0;
}

@media (min-width: 960px) {
  .hero {
    padding-bottom: 64px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "copy field" "controls field" "status field";
    column-gap: 40px;
    min-height: min(calc(100svh - 72px), 800px);
  }

  .hero-copy {
    padding-top: 64px;
  }

  .field {
    height: auto;
    min-height: 560px;
    margin-inline: 0 calc(var(--gutter) * -1);
  }

  .status {
    align-self: end;
  }
}

/* Paper sections */
section h2 {
  font: 500 clamp(2rem, 1.5rem + 2vw, 3rem) / 1.08 var(--serif);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.how,
.principles,
.launch {
  padding-block: 72px;
}

.section-intro {
  display: grid;
  gap: 16px;
}

.section-intro p {
  color: var(--slate);
  margin: 0;
  max-width: 34em;
}

/* The three steps are a real sequence, so they are numbered. */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  gap: 32px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-content: start;
  column-gap: 12px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font: 400 2rem/1 var(--serif);
  color: var(--slate);
}

.steps h3 {
  font: 600 1.3125rem/1.25 var(--serif);
  margin: 0 0 8px;
}

.steps p {
  color: var(--slate);
  margin: 0;
}

.principles {
  background: var(--paper-2);
}

.principle-list {
  margin: 40px 0 0;
  display: grid;
  gap: 28px;
}

.principle-list div {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

.principle-list dt {
  font: 600 1.1875rem/1.3 var(--serif);
  margin-bottom: 6px;
}

.principle-list dd {
  color: var(--slate);
  margin: 0;
  max-width: 36em;
}

.launch-grid {
  display: grid;
  gap: 32px;
}

.launch-grid p {
  color: var(--slate);
  max-width: 34em;
  margin: 16px 0 0;
}

.launch-grid .note {
  font: 400 0.9375rem/1.6 var(--sans);
  border-left: 2px solid var(--ink);
  padding-left: 16px;
  margin: 0;
  align-self: center;
}

@media (min-width: 800px) {
  .how,
  .principles,
  .launch {
    padding-block: 104px;
  }

  .section-intro {
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    align-items: end;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
  }

  .principle-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    row-gap: 36px;
  }

  .launch-grid {
    grid-template-columns: 3fr 2fr;
    column-gap: 64px;
  }
}

.site-footer {
  border-top: 1px solid var(--rule);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 28px;
  font: 400 0.875rem/1.4 var(--sans);
  color: var(--slate);
}

.footer-row .brand {
  color: var(--ink);
  font-size: 1rem;
}

.footer-row nav {
  display: flex;
  gap: 18px;
}

.footer-row nav a {
  text-decoration: none;
}

.footer-row nav a:hover {
  text-decoration: underline;
}

.footer-row p {
  margin: 0 0 0 auto;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
