@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #eef1f5;
  --sheet: #ffffff;
  --ink: #1c2633;
  --ink-2: #4f5c6c;
  --ink-3: #6f7b8a;
  --rule: #d5dbe3;
  --pen: #2346b0;
  --pen-hover: #1a3790;
  --on-pen: #ffffff;
  --marker: #ffe45c;
  --marker-soft: #fff3b0;
  --marker-ink: #1c2633;
  --redline: #b3261e;
  --ok: #1f7a45;
  --focus: #2346b0;
  --shadow: 0 1px 0 rgba(28, 38, 51, 0.06), 0 8px 24px -12px rgba(28, 38, 51, 0.18);

  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --gutter: 16px;
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #161b23;
    --sheet: #1e252f;
    --ink: #e7eaef;
    --ink-2: #a9b3c0;
    --ink-3: #8994a3;
    --rule: #303a47;
    --pen: #93aaff;
    --pen-hover: #b3c3ff;
    --on-pen: #10162a;
    --marker: rgba(255, 216, 61, 0.36);
    --marker-soft: rgba(255, 216, 61, 0.16);
    --marker-ink: #fff8d6;
    --redline: #ff8f85;
    --ok: #6fd39a;
    --focus: #93aaff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161b23;
  --sheet: #1e252f;
  --ink: #e7eaef;
  --ink-2: #a9b3c0;
  --ink-3: #8994a3;
  --rule: #303a47;
  --pen: #93aaff;
  --pen-hover: #b3c3ff;
  --on-pen: #10162a;
  --marker: rgba(255, 216, 61, 0.36);
  --marker-soft: rgba(255, 216, 61, 0.16);
  --marker-ink: #fff8d6;
  --redline: #ff8f85;
  --ok: #6fd39a;
  --focus: #93aaff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: var(--pen); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--pen-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

button, input, textarea, select { font: inherit; color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
select, option { background: var(--sheet); color: var(--ink); }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark span {
  background: var(--marker);
  color: var(--marker-ink);
  padding: 0 0.12em;
  border-radius: 0.2em 0.5em 0.25em 0.45em;
}
.masthead nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.masthead nav a { color: var(--ink-2); text-decoration: none; padding: 0.5rem 0; }
.masthead nav a:hover { color: var(--ink); text-decoration: underline; }

/* Landing */
.landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding: 1.5rem 0 3rem;
}
@media (min-width: 960px) {
  .landing { grid-template-columns: minmax(0, 31rem) minmax(0, 1fr); gap: 4.5rem; padding-top: 3.5rem; align-items: start; }
}

h1 {
  font-family: var(--sans);
  font-weight: 750;
  font-size: clamp(2.35rem, 7vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.lede { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 1.75rem; max-width: 30rem; }

.paste label.field-label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.paste textarea {
  display: block;
  width: 100%;
  min-height: 11rem;
  resize: vertical;
  padding: 0.9rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(28, 38, 51, 0.04);
}
.paste textarea::placeholder { color: var(--ink-3); font-family: var(--sans); }
.paste textarea:focus-visible { outline-offset: 0; }
.paste-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-3); margin: 0.35rem 0 1rem; gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 6px;
  background: var(--pen);
  color: var(--on-pen);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--pen-hover); color: var(--on-pen); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.quiet {
  background: transparent;
  color: var(--pen);
  border: 1px solid var(--rule);
  font-weight: 600;
}
.btn.quiet:hover { border-color: var(--pen); background: transparent; color: var(--pen-hover); }
.btn.small { min-height: 40px; padding: 0 0.9rem; font-size: 0.95rem; }

.upload { position: relative; font-weight: 600; color: var(--pen); cursor: pointer; padding: 0.6rem 0; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload:hover { text-decoration: underline; }
.upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.notice {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--pen);
  background: var(--sheet);
  font-size: 0.97rem;
}
.notice.error { border-left-color: var(--redline); }
.notice[hidden] { display: none; }

.samples { margin-top: 2.25rem; }
.samples h2 { font-size: 1rem; font-weight: 700; margin: 0 0 0.6rem; }
.sample-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.sample-list button {
  width: 100%;
  min-height: 56px;
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.25;
}
.sample-list button strong { display: block; font-size: 1rem; }
.sample-list button span { font-size: 0.85rem; color: var(--ink-3); }
.sample-list button:hover { border-color: var(--pen); }
@media (max-width: 559px) {
  .sample-list { grid-template-columns: minmax(0, 1fr); }
  .sample-list button { min-height: 52px; padding: 0.6rem 0.9rem; }
  .paste textarea { min-height: 7rem; }
  .lede { font-size: 1.05rem; margin-bottom: 1.4rem; }
}

/* Specimen: the one memorable thing on the landing page */
.specimen { position: relative; margin: 0; }
.specimen .sheet {
  background: var(--sheet);
  box-shadow: var(--shadow);
  border-radius: 3px;
  padding: 1.6rem 1.5rem 1.8rem;
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.specimen .sheet p { margin: 0 0 0.9rem; }
.specimen .sheet b { color: var(--ink); font-weight: 600; }
.specimen mark, .doc mark {
  background: var(--marker);
  color: var(--marker-ink);
  padding: 0.05em 0.1em;
  border-radius: 0.2em 0.45em 0.25em 0.4em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.margin-note {
  margin: 1rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--pen);
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink);
  max-width: 26rem;
}
.margin-note small { display: block; color: var(--ink-3); font-size: 0.85rem; margin-top: 0.3rem; }
@media (min-width: 960px) {
  .specimen { padding-top: 0.5rem; }
  .specimen .sheet { padding: 2.2rem 2.4rem 2.4rem; font-size: 0.95rem; transform: none; }
  .margin-note { margin: 1.25rem 0 0 2.4rem; }
}

/* Reading view */
.doc-head { padding: 1.25rem 0 1rem; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.kind { color: var(--ink-3); font-size: 0.95rem; margin: 0.5rem 0 0.15rem; }
.doc-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 0.4rem; }
.parties { margin: 0; color: var(--ink-2); }
.source-line { margin: 0.6rem 0 0; font-size: 0.88rem; color: var(--ink-3); }

.tabs { display: flex; gap: 0; position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.tabs button {
  flex: 1;
  min-height: 48px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
@media (min-width: 960px) { .tabs { display: none; } }

.reading-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding: 1rem 0 3rem; }
@media (min-width: 960px) {
  .reading-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 3rem; align-items: start; }
  .reading-grid .panel[hidden] { display: block; }
}

.reading { max-width: var(--measure); }
.reading section { margin: 0 0 2.4rem; }
.reading h2 {
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.reading h2 .count { font-weight: 400; color: var(--ink-3); font-size: 1rem; margin-left: 0.35rem; }
.summary { font-size: 1.15rem; line-height: 1.55; margin: 0; }

.terms { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.terms div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dotted var(--rule); }
.terms dt { color: var(--ink-2); }
.terms dd { margin: 0; font-weight: 700; }
.terms dd button { all: unset; cursor: pointer; border-bottom: 1px dashed transparent; }
.terms dd button:hover, .terms dd button:focus-visible { border-bottom-color: var(--ink-3); }

.items { list-style: none; padding: 0; margin: 0; }
.item { padding: 0.9rem 0 1rem; border-bottom: 1px solid var(--rule); }
.item:last-child { border-bottom: 0; }
.item h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.25rem; line-height: 1.3; }
.push .item h3::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--redline);
  vertical-align: 0.12em;
}
.item p { margin: 0 0 0.45rem; }
.ask { color: var(--ink); }
.ask b { color: var(--pen); }
.item.lit { background: var(--marker-soft); margin: 0 -0.6rem; padding-left: 0.6rem; padding-right: 0.6rem; border-radius: 4px; }

.wording-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--pen);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.wording-toggle:hover { text-decoration: underline; }
.wording-toggle .where { color: var(--ink-3); font-weight: 400; }
.wording {
  margin: 0.25rem 0 0.4rem;
  padding: 0.7rem 0.9rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.55;
}
.wording mark { background: var(--marker); color: var(--marker-ink); padding: 0.05em 0.1em; border-radius: 0.2em 0.45em 0.25em 0.4em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.wording a { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; }
.wording .check { display: block; margin-top: 0.5rem; font-family: var(--sans); font-size: 0.85rem; color: var(--ok); }
.wording .check.missing { color: var(--redline); }

.dates { list-style: none; padding: 0; margin: 0 0 1rem; }
.dates li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dotted var(--rule); }
.dates time, .dates .tbd { font-weight: 700; }
.dates .tbd { color: var(--ink-3); font-weight: 400; font-size: 0.95rem; }
.dates .label { font-weight: 700; display: block; }
.dates .when { color: var(--ink-2); font-size: 0.97rem; }
@media (max-width: 420px) { .dates li { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 0.15rem 0; }
.checklist label { display: flex; gap: 0.75rem; align-items: flex-start; min-height: 44px; padding: 0.45rem 0; cursor: pointer; }
.checklist input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--pen); }
.checklist input:checked + span { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }

.letter {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  margin: 0 0 0.9rem;
}
.letter .subject { font-weight: 700; margin: 0 0 0.6rem; }
.letter .body { white-space: pre-wrap; margin: 0; font-family: var(--sans); font-size: 0.98rem; overflow-wrap: anywhere; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* The document panel */
.doc-panel { min-width: 0; }
@media (min-width: 960px) {
  .doc-panel { position: sticky; top: 1rem; }
  .doc-panel .doc { max-height: calc(100vh - 6rem); overflow: auto; }
}
.doc-panel h2 { font-size: 1rem; font-weight: 700; color: var(--ink-2); margin: 0 0 0.6rem; }
.doc {
  background: var(--sheet);
  box-shadow: var(--shadow);
  border-radius: 3px;
  padding: 1.3rem 1.2rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}
.doc mark { cursor: pointer; }
.doc mark.soft { background: var(--marker-soft); }
.doc mark.faint { background: none; color: inherit; padding: 0; border-radius: 0; border-bottom: 2px dotted var(--ink-3); }
.doc mark.lit { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .doc mark.flash { animation: flash 1.2s ease-out 1; }
  @keyframes flash { 0% { outline: 4px solid var(--pen); } 100% { outline: 2px solid transparent; } }
}

.loading { padding: 3rem 0; max-width: var(--measure); }
.loading p { font-size: 1.15rem; }
.bar { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; margin-top: 1rem; }
.bar i { display: block; height: 100%; width: 30%; background: var(--pen); }
@media (prefers-reduced-motion: no-preference) {
  .bar i { animation: slide 1.4s ease-in-out infinite; }
  @keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
}

/* Prose pages */
.prose { max-width: var(--measure); padding: 1.5rem 0 3rem; }
.prose h1 { font-size: clamp(2rem, 6vw, 3rem); }
.prose h2 { font-size: 1.25rem; margin: 2rem 0 0.4rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2rem; }

footer.site {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
footer.site p { margin: 0; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
footer.site a { color: var(--ink-2); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 960px) { .reading-grid .panel[hidden] { display: block !important; } }
