/* Shared foundation. Each site appends one layout file and its own theme.css (fonts + colors). */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --gutter: clamp(1.1rem, 5vw, 5rem);
  --measure: 41rem;
  --rule: color-mix(in srgb, var(--foreground) 24%, var(--background));
  --muted: color-mix(in srgb, var(--foreground) 76%, var(--background));
  --tint: color-mix(in srgb, var(--accent) 11%, var(--background));
  --highlight: color-mix(in srgb, var(--accent) 28%, var(--background));
  --surface: var(--background);
  --display: var(--body);
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--body);
  font-size: clamp(1.04rem, .97rem + .32vw, 1.2rem);
  line-height: 1.62;
  font-synthesis-weight: none;
  font-kerning: normal;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  max-width: 16ch;
  font-size: clamp(2.55rem, 1.55rem + 5vw, 6.3rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.02;
}

h2 {
  margin-bottom: .65em;
  font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -.015em;
}

h3 {
  margin-bottom: .3em;
  font-size: 1.12em;
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: .09em;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--accent);
}

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

mark {
  padding: 0 .12em;
  background: var(--highlight);
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

::selection {
  background: var(--accent);
  color: var(--background);
}

.edition {
  max-width: 76rem;
  margin-inline: auto;
  padding: clamp(1.2rem, 3vw, 2.5rem) var(--gutter) clamp(2.5rem, 6vw, 5rem);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .3rem 1.5rem;
  padding-block: .4rem 1rem;
}

.brand {
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(1.05rem, 1rem + .4vw, 1.35rem);
  font-weight: 700;
  line-height: 1.2;
}

.tagline {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.35;
}

.hero {
  padding-block: clamp(2.4rem, 8vw, 6.5rem) clamp(1.5rem, 4vw, 3rem);
}

.kicker {
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.dek {
  max-width: 38ch;
  margin: 1.4rem 0 0;
  font-size: clamp(1.18rem, 1.04rem + .62vw, 1.6rem);
  line-height: 1.4;
}

.intro,
.block,
.colophon,
.toc {
  max-width: var(--measure);
}

.intro > p:first-child {
  font-size: 1.1em;
}

.block {
  margin-top: clamp(2.6rem, 6vw, 4.6rem);
}

.list {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.list li + li {
  margin-top: .5em;
}

.list li::marker {
  color: var(--accent);
}

/* On-this-page navigation */
.toc {
  margin-top: 1.5rem;
}

.toc-label {
  margin-bottom: .4rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
  line-height: 1.4;
}

/* Steps */
.steps {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 3.4rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: -.15rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--background);
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
}

.steps p:last-child {
  margin: 0;
}

/* Glossary */
.glossary {
  display: grid;
  gap: 1.2rem;
  margin: 0 0 1em;
}

.glossary .term {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.glossary dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .8rem;
}

.glossary dfn {
  font-family: var(--display);
  font-size: 1.22em;
  font-style: normal;
  font-weight: 700;
}

.glossary .leader {
  display: none;
}

.glossary .say {
  color: var(--accent);
  font-style: italic;
}

.glossary dd {
  margin: .35rem 0 0;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.4rem;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding-top: .9rem;
  border-top: 3px solid var(--accent);
}

.figure {
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(2.5rem, 2rem + 2.4vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}

.stats .label {
  line-height: 1.45;
}

.stats .source {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}

/* Quote */
.block-quote {
  margin-inline: 0;
}

.block-quote blockquote {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 2.05rem);
  line-height: 1.3;
}

.block-quote blockquote p:last-child {
  margin: 0;
}

.block-quote figcaption {
  margin-top: .9rem;
  color: var(--muted);
  font-size: .9rem;
}

/* Receipt */
.receipt {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .94rem;
}

.receipt caption {
  padding-bottom: .5rem;
  color: var(--muted);
  font-size: .8rem;
  text-align: left;
}

.receipt th {
  padding: .5rem 0;
  font-weight: 400;
  text-align: left;
}

.receipt td {
  padding: .5rem 0 .5rem 1rem;
  text-align: right;
  vertical-align: bottom;
  white-space: nowrap;
}

.receipt tbody tr {
  border-bottom: 1px dashed var(--rule);
}

.receipt tfoot th,
.receipt tfoot td {
  padding-top: .75rem;
  border-top: 3px double var(--foreground);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.receipt-note {
  margin-top: .9rem;
  color: var(--muted);
  font-size: .85rem;
}

/* Resources */
.resources {
  display: grid;
  gap: .9rem;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.resources li {
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: .5rem;
}

.resources a {
  font-family: var(--display);
  font-weight: 700;
}

.resources p {
  margin: .3rem 0 0;
  font-size: .95rem;
}

/* Chat */
.chat {
  display: grid;
  gap: .85rem;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.msg {
  max-width: min(34rem, 90%);
  padding: .8rem 1rem;
  border-radius: 1.1rem;
}

.msg p {
  margin: 0;
}

.msg p + p {
  margin-top: .5em;
}

.msg .who {
  display: block;
  margin-bottom: .3rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  opacity: .85;
  text-transform: uppercase;
}

.msg-you {
  justify-self: end;
  border-bottom-right-radius: .3rem;
  background: var(--accent);
  color: var(--background);
}

.msg-you a {
  text-decoration-color: currentColor;
}

.msg-bot {
  justify-self: start;
  border-bottom-left-radius: .3rem;
  background: var(--tint);
}

/* Timeline */
.timeline {
  display: grid;
  gap: 1.15rem;
  margin: 0 0 1em;
  padding: 0 0 0 1.4rem;
  border-left: 2px solid var(--accent);
  list-style: none;
}

.timeline li {
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: .5em;
  left: calc(-1.4rem - 7px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline li.struck::before {
  background: var(--background);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.when {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.timeline s {
  text-decoration-thickness: .14em;
}

.timeline p {
  margin: .2rem 0 0;
}

/* Callout */
.block-callout {
  padding: 1.2rem 1.4rem;
  border-left: 4px solid var(--accent);
  background: var(--tint);
}

.callout-label {
  margin-bottom: .45rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.block-callout p:last-child {
  margin: 0;
}

/* FAQ */
.qa {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.qa + .qa {
  margin-top: 1.2rem;
}

.qa p:last-child {
  margin: 0;
}

/* Mock court document */
.doc {
  position: relative;
  padding: clamp(1.1rem, 4vw, 2rem);
  border: 1px solid var(--rule);
  background: var(--surface);
}

.doc-court {
  margin-bottom: .4rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

.doc-title {
  margin-bottom: 1.2rem;
  font-family: var(--display);
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.doc-fields {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.field {
  display: grid;
  gap: .25rem;
}

.field dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field dd {
  margin: 0;
}

.field .value {
  display: block;
  padding-bottom: .2rem;
  border-bottom: 1px solid var(--foreground);
}

.field .note {
  display: block;
  margin-top: .3rem;
  color: var(--accent);
  font-family: var(--hand);
  font-size: 1.3em;
  line-height: 1.15;
}

.stamp {
  position: absolute;
  top: .9rem;
  right: .9rem;
  padding: .15rem .55rem;
  border: 3px solid var(--accent);
  border-radius: .2rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .15em;
  opacity: .85;
  text-transform: uppercase;
  transform: rotate(-8deg);
}

.doc-fine {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

/* Decorative marks in the hero */
.marks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
}

.marks li {
  padding: .25rem .6rem;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Footer */
.colophon {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .92rem;
}

.signoff {
  font-size: 1.05rem;
}

.disclaimer {
  color: var(--muted);
}

.colophon .meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .05em;
}

@media print {
  body {
    --foreground: #000;
    --background: #fff;
    --surface: #fff;
    --accent: #222;
    background: #fff;
  }

  .edition {
    max-width: none;
    padding: 0;
    box-shadow: none;
    mask: none;
  }

  .toc,
  .marks {
    display: none;
  }

  h1 {
    font-size: 30pt;
  }
}

/* Layout: sticker */
/* Sticker: a loud comedy zine on polka-dot paper. */
body {
  background-color: var(--background);
  background-image: radial-gradient(color-mix(in srgb, var(--foreground) 10%, transparent) 1.1px, transparent 1.3px);
  background-size: 22px 22px;
}

.brand {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: .35rem;
  background: var(--foreground);
  color: var(--background);
  transform: rotate(-2deg);
}

.tagline {
  font-style: italic;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.7rem, 1.5rem + 6vw, 7rem);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: .98;
}

h1 mark {
  padding: 0 .08em;
}

.dek {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
}

.marks {
  gap: .8rem;
}

.marks li {
  border: 2px solid var(--foreground);
  border-radius: .4rem;
  background: var(--accent);
  color: var(--background);
  font-size: .78rem;
  box-shadow: 3px 3px 0 var(--foreground);
  transform: rotate(-3deg);
}

.marks li:nth-child(2) {
  background: var(--highlight);
  color: var(--foreground);
  transform: rotate(2deg);
}

.marks li:nth-child(3) {
  background: var(--surface);
  color: var(--foreground);
  transform: rotate(-1deg);
}

h2 {
  font-weight: 800;
  letter-spacing: -.03em;
}

.block-callout {
  border: 2px solid var(--foreground);
  border-radius: .5rem;
  background: var(--highlight);
  box-shadow: 6px 6px 0 var(--foreground);
  transform: rotate(-1deg);
}

.block-callout .callout-label {
  color: var(--foreground);
}

.block-quote blockquote {
  font-style: italic;
  font-weight: 600;
}

.block-quote blockquote::before {
  content: "“";
  display: block;
  height: .55em;
  color: var(--accent);
  font-size: 2.6em;
  line-height: 1;
}

.qa h3::before {
  content: "Q. ";
  color: var(--accent);
}

.colophon {
  border-top: 2px dashed var(--foreground);
}
