:root {
  color-scheme: light;
  --paper: #faf5eb;
  --ink: #30252b;
  --muted: #69555d;
  --wine: #74334f;
  --wine-deep: #542139;
  --wash: #eedee4;
  --marker: #d7aabd;
  --rule: #bca5ad;
  --heading: "Bodoni 72", Didot, "Bodoni MT", "Times New Roman", serif;
  --text: Baskerville, "Hoefler Text", "Palatino Linotype", Palatino, Georgia, serif;
  font-family: var(--text);
  font-size: 20px;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; border-radius: 0; }
[hidden] { display: none !important; }
body { margin: 0; }
body > header, main, body > footer {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 48px;
}
p, li, h1, h2, h3, h4, h5, h6, a, label, legend { overflow-wrap: anywhere; }
a {
  display: inline-block;
  max-width: 100%;
  min-height: 44px;
  min-width: 44px;
  padding-block: 7px;
  color: var(--wine);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .2em;
}
a:hover { color: var(--wine-deep); text-decoration-thickness: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--wine);
  outline-offset: 5px;
}
:target { scroll-margin-top: 24px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--wine); color: var(--paper); }
[data-skip] {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  background: var(--paper);
  border: 2px solid var(--wine);
  transform: translateY(-200%);
}
[data-skip]:focus { transform: translateY(0); }

body > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding-block: 22px;
  border-bottom: 2px solid var(--wine);
}
header p { color: var(--wine); margin: 0; font-style: italic; }
header a { font-size: .95rem; }
header a span { margin-left: 10px; }
main { padding-block: 64px 72px; }
p { margin: 0 0 20px; max-width: 65ch; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading);
  font-weight: 400;
  color: var(--wine-deep);
  line-height: 1.13;
  text-wrap: pretty;
}
strong { font-weight: 700; }
h1 {
  font-size: clamp(3.25rem, 7.2vw, 5.2rem);
  letter-spacing: -.025em;
  margin: 18px 0 28px;
  max-width: 12ch;
}
/* A broad, uneven pencil stroke under the title, rather than a panel. */
h1::after {
  content: "";
  display: block;
  width: 2.8em;
  max-width: 90%;
  height: .11em;
  margin-top: .14em;
  background: var(--marker);
  clip-path: polygon(0 30%, 27% 10%, 62% 22%, 99% 0, 100% 59%, 65% 83%, 25% 77%, 1% 100%);
  transform: rotate(-1.5deg);
}
h2, article h3 {
  font-size: clamp(1.65rem, 2.9vw, 2.3rem);
  margin: 0 0 24px;
  max-width: 29ch;
}
h3 { font-size: 1.5rem; }
[data-eyebrow] {
  color: var(--wine);
  font-size: 1rem;
  font-style: italic;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}
[data-opening] {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  margin-bottom: 64px;
}
[data-opening] > div { min-width: 0; }
[data-opening]:not(:has(figure)) { grid-template-columns: minmax(0, 960px); }
[data-opening]:not(:has(figure)) h1 { max-width: 18ch; }
[data-intro] { font-size: 1.25rem; line-height: 1.5; max-width: 42ch; }
[data-lead] { color: var(--muted); font-style: italic; max-width: 48ch; margin-top: 24px; }
figure {
  margin: 0;
  min-width: 0;
  width: 100%;
  max-width: 390px;
  justify-self: end;
}
img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}
/* Preserve the original diagrams as quiet ink on paper, without neon. */
figure img { filter: grayscale(1) invert(1); mix-blend-mode: multiply; }
figcaption {
  color: var(--wine);
  font-size: 1rem;
  font-style: italic;
  padding-block: 18px 10px;
  border-top: 2px solid var(--wine);
  margin-top: 16px;
}
article { max-width: 1056px; }
article [data-answer] {
  max-width: 900px;
  border-top: 1px solid var(--rule);
  margin-block: 0 32px;
  padding-block: 36px 16px;
}
article > section:first-child > [data-answer]:first-child { border-top: 2px solid var(--wine); }
[data-answer="alternate"] { margin-left: 8%; }
article [data-answer] h2, article [data-answer] h3 {
  text-decoration: underline;
  text-decoration-color: var(--marker);
  text-decoration-thickness: .075em;
  text-underline-offset: .13em;
  text-decoration-skip-ink: none;
}
article [data-answer][data-signal="urgent"] {
  padding: 32px;
  border-top: 4px solid var(--wine);
  background: var(--wash);
}
article [data-answer] > :last-child { margin-bottom: 0; }
[data-source] { font-size: .95rem; margin-left: 8px; }
ul, ol { padding-left: 26px; margin-block: 0 24px; }
li { padding-left: 8px; margin-bottom: 10px; max-width: 65ch; }
li::marker { color: var(--wine); }
[data-next] { margin: 48px 0 0; }
[data-next] a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  min-height: 56px;
  background: var(--wine);
  color: var(--paper);
  font-weight: 700;
}
[data-next] a:hover { background: var(--wine-deep); }
[data-next] span { flex: 0 0 auto; }

body > footer {
  padding-block: 48px 32px;
  border-top: 3px solid var(--wine);
  background: var(--wash);
}
footer h2 { margin-top: 12px; }
footer nav ol {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-block: 32px;
}
footer nav li { margin: 0; padding: 0; max-width: none; min-width: 0; }
footer nav a {
  color: var(--wine-deep);
  height: 100%;
  min-height: 144px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 12px;
  align-items: start;
  padding-block: 16px;
  border-top: 2px solid var(--rule);
  text-decoration: none;
}
footer nav a > span:first-child { color: var(--muted); grid-column: 1 / -1; font-style: italic; }
footer nav a strong { align-self: center; font-size: 1.1rem; line-height: 1.3; }
footer nav a > span:last-child { align-self: center; }
footer nav a:hover strong, footer nav a[aria-current="page"] strong {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}
footer nav a:hover, footer nav a[aria-current="page"] { border-top-color: var(--wine); }
footer > p { color: var(--muted); }

fieldset { border: 0; padding: 0; margin: 32px 0 0; min-width: 0; }
legend { color: var(--wine-deep); font-weight: 700; padding: 0 0 16px; max-width: 100%; }
fieldset ul { list-style: none; padding: 0; margin: 0; }
fieldset li { padding: 0; margin: 0; border-top: 1px solid var(--rule); max-width: none; }
fieldset label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  min-height: 72px;
  padding-block: 16px;
  cursor: pointer;
}
input[type="checkbox"] {
  appearance: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 2px solid var(--wine);
  background: var(--paper);
  cursor: pointer;
  position: relative;
}
input[type="checkbox"]:checked { background: var(--wine); }
input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 12px;
  height: 24px;
  border: solid var(--paper);
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
  position: absolute;
  left: 14px;
  top: 5px;
}
fieldset label span { padding-top: 6px; min-width: 0; }
fieldset label:has(input:checked) span { text-decoration: underline; text-decoration-color: var(--marker); text-underline-offset: .18em; }
#question-tools { border-top: 2px solid var(--wine); padding-top: 24px; margin-top: 24px; }
#question-status { color: var(--wine-deep); }
#question-tools > label { display: block; font-weight: 700; margin-bottom: 8px; }
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 200px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--wine);
  resize: vertical;
  padding: 16px;
  font: inherit;
}
button {
  font: inherit;
  line-height: 1.4;
  min-width: 44px;
  max-width: 100%;
  min-height: 48px;
  cursor: pointer;
  background: var(--wine);
  color: var(--paper);
  border: 2px solid var(--wine);
  padding: 12px 16px;
  font-weight: 700;
}
button:hover { background: var(--wine-deep); border-color: var(--wine-deep); }
button:disabled { cursor: default; color: var(--muted); background: var(--wash); border-color: var(--rule); }
[data-actions] { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
#copy-status { color: var(--wine-deep); min-height: 1.65em; }

@media (max-width: 960px) {
  body > header, main, body > footer { padding-inline: 32px; }
  [data-opening] { gap: 32px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  footer nav ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-answer="alternate"] { margin-left: 32px; }
}

@media (max-width: 640px) {
  :root { font-size: 18px; }
  body > header, main, body > footer { padding-inline: 24px; }
  body > header { flex-direction: column; align-items: flex-start; gap: 4px; padding-block: 16px; }
  main { padding-block: 36px 48px; }
  h1 { font-size: 3rem; max-width: 13ch; }
  [data-opening], [data-opening]:not(:has(figure)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 40px;
  }
  [data-opening]:not(:has(figure)) h1 { max-width: 13ch; }
  [data-intro] { font-size: 1.2rem; }
  figure { max-width: 320px; justify-self: start; }
  article [data-answer], [data-answer="alternate"] { margin-left: 0; padding-block: 28px 12px; margin-bottom: 24px; }
  article [data-answer][data-signal="urgent"] { padding: 24px; }
  article [data-answer] h2, article [data-answer] h3 { font-size: 1.85rem; }
  [data-source] { margin-left: 0; }
  footer nav ol { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  footer nav a { min-height: 112px; }
  [data-next] a { width: 100%; gap: 16px; padding-inline: 16px; }
  [data-actions] { gap: 8px; }
  [data-actions] button { width: 100%; }
  fieldset label { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  input[type="checkbox"] { appearance: auto; }
  input[type="checkbox"]:checked::after { display: none; }
}

@media print {
  :root { color-scheme: light; color: #111; background: #fff; font-size: 12pt; }
  body { background: #fff; }
  body > header, body > footer, figure, [data-skip], [data-next], [data-actions], #copy-status { display: none; }
  main { padding: 0; }
  [data-opening] { display: block; margin-bottom: 24px; }
  h1, h2, h3, [data-eyebrow], [data-lead], #question-status, legend { color: #111; }
  h1 { font-size: 36pt; }
  h1::after { display: none; }
  [data-intro] { font-size: 1rem; }
  article [data-answer], [data-answer="alternate"], article [data-answer][data-signal="urgent"] {
    background: #fff;
    border-color: #444;
    margin: 0 0 24px;
    padding: 16px 0;
    max-width: none;
  }
  p, li, [data-source] { color: #111; }
  textarea { color: #111; background: #fff; border-color: #555; height: 28rem; }
  body[data-print-questions] [data-opening], body[data-print-questions] article [data-answer]:not(#question-kit), body[data-print-questions] fieldset, body[data-print-questions] #question-kit > p { display: none; }
  body[data-print-questions] #question-kit { border: none; padding: 0; }
  body[data-print-questions] #question-tools { border: none; margin: 0; }
  body[data-print-questions] #question-tools > p, body[data-print-questions] #question-tools > label, body[data-print-questions] textarea { display: none; }
  body[data-print-questions] #question-print ol { padding-left: 24px; }
  body[data-print-questions] #question-print li { margin-bottom: 16px; break-inside: avoid; }
}
