/* The homepage has its own small stylesheet: cream paper, warm dark-brown ink
   and one blue, set in Charter at a narrow measure. It deliberately shares
   nothing with styles.css beyond the font files, so the two can move apart. */

@font-face {
  font-family: 'Charter';
  src: url('/public/fonts/Charter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Charter';
  src: url('/public/fonts/Charter-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Charter';
  src: url('/public/fonts/Charter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono, only for the small technical labels on the homepage. */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/public/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Fraunces, for headings: at a heavy weight with its soft axis turned up it
   comes close to the lettering of the wordmark. */
@font-face {
  font-family: 'Fraunces';
  src: url('/public/fonts/Fraunces-Variable-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F5EEE1;
  --ink: #2B231D;
  --ink-soft: #5C5145;
  --rule: #E0D5C2;
  --accent: #24476B;        /* deep ink blue, shared with the wordmark; the only colour on the page */
  --accent-wash: #DCE3EA;   /* the same blue, thinned for Herein's panel */
  /* The homepage is drawn like a manual: ink frames with a hard shadow, and
     hatching where a printer would have used a tint. */
  --frame: 2px solid var(--ink);
  --drop: 4px 4px 0 var(--ink);
  --hatch: repeating-linear-gradient(-45deg, rgba(43, 35, 29, 0.16) 0 1px, transparent 1px 6px);
  --display: 'Fraunces', 'Charter', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --measure: 38rem;
  --gutter: 1.5rem;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Charter', 'Bitstream Charter', 'Iowan Old Style', Georgia, serif;
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.column {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ===== Header ===== */

.masthead .column {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.wordmark {
  display: block;
  line-height: 0;
}

.wordmark img {
  display: block;
  width: auto;
  height: 44px;
}

/* The nav is set in Fraunces, like the headings and the wordmark beside it,
   so the header reads as one piece. */
.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 600;
  font-size: 1.0625rem;
}

.masthead nav a {
  color: var(--ink);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* ===== Sections ===== */

main section {
  padding: 3.5rem 0;
}

/* The dividing rules keep to the reading column rather than running the
   width of the window. */
main section + section {
  padding-top: 0;
}

main section + section .column::before,
footer .column::before {
  content: "";
  display: block;
  border-top: 1px solid var(--rule);
  margin-bottom: 3.5rem;
}

h1,
h2 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
}

h1 {
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

/* The last word of the headline is underlined by a line that sweeps in
   once, quickly, as the page loads. */
.swept {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--accent);
}

/* On the homepage the word turns over a few times and settles. The word
   fades up and out, the next fades in from below, and the one underline
   keeps its place, only changing length to fit. */
.swept-word {
  display: inline-block;
  transition: opacity 170ms ease, transform 170ms ease;
}

.swept-word.is-leaving {
  opacity: 0;
  transform: translateY(-0.12em);
}

.swept-word.is-arriving {
  opacity: 0;
  transform: translateY(0.12em);
  transition: none;
}

.swept::after {
  content: "";
  position: absolute;
  left: 0;
  width: var(--underline, 100%);
  transition: width 200ms ease;
  bottom: -0.06em;
  height: 0.08em;
  border-radius: 0.04em;
  background: currentColor;
  transform-origin: left;
  animation: sweep 420ms cubic-bezier(0.2, 0.8, 0.2, 1) 250ms both;
}

@keyframes sweep {
  from { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .swept::after { animation: none; }
}

p + p {
  margin-top: 1rem;
}

.intro {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.intro p {
  color: var(--ink-soft);
  font-size: 1.3125rem;
}

/* ===== Homepage ===== */

/* The homepage is laid out in three bands -- the opening, three columns, and
   a closing row -- so it runs much wider than the reading measure. Running
   text inside it still keeps to a comfortable line length. */
.home .column {
  max-width: calc(78rem + 2 * var(--gutter));
}

h3 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 650;
  font-size: 1.125rem;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

/* Small monospace labels, for naming a section or a field. */
.tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.55;
}

/* ----- The opening ----- */

.hero {
  padding: 0.5rem 0 2.75rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem 4rem;
  align-items: center;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  margin: 0;
}

/* ----- Drawings -----
   Everything is drawn in the same hand: thin strokes with round ends, and a
   little navy where something is being pointed at. */
.sketch,
.spec-fig,
.cross,
.plus {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch .accent,
.spec-fig .accent {
  stroke: var(--accent);
  stroke-width: 2.2;
}

.sketch rect.accent {
  fill: var(--accent-wash);
}

.sketch .fill,
.spec-fig .fill {
  fill: var(--accent);
  stroke: none;
}

/* The four panels: small technical sheets in a two-by-two grid, each with a
   register mark in the corner. */
.specimens {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: var(--frame);
  border-radius: 3px;
  background: #EFE6D6;
  box-shadow: var(--drop);
}

.spec {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.25rem 1.25rem;
}

.spec:nth-child(even) {
  border-left: var(--frame);
}

.spec:nth-child(n + 3) {
  border-top: var(--frame);
}

.spec .cross {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 0.9rem;
  height: 0.9rem;
  stroke-width: 1.2;
  stroke: var(--ink);
}

.specimens p + p {
  margin-top: 0;
}

.specimens .spec-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* The panel number is set like a step in a manual, white on ink. */
.spec-meta span:first-child {
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
}

.specimens .spec-title {
  margin-top: 0.6rem;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.2;
}

.specimens .spec-caption {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.spec-fig {
  display: block;
  width: 100%;
  max-width: 13rem;
  height: auto;
  margin-top: auto;
  padding-top: 1.1rem;
}

.spec-fig text {
  fill: var(--ink);
  stroke: none;
  font-family: var(--mono);
  font-size: 13px;
  text-anchor: middle;
}

.spec-fig .pin-num {
  fill: var(--paper);
  font-size: 7px;
}

.spec-fig .thin {
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.spec-fig .lbl {
  font-size: 7.5px;
  letter-spacing: 0.06em;
}

.spec-fig .live {
  fill: var(--accent-wash);
}

.spec-fig .mark {
  fill: var(--accent-wash);
  stroke: var(--accent);
  stroke-width: 1;
}

.spec-fig.dots circle {
  fill: var(--ink);
  stroke: none;
}

.spec-fig.dots .hollow {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}

.spec-fig.dots .ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

/* ----- Three columns ----- */

.band-grid {
  display: grid;
  grid-template-columns: 30fr 40fr 30fr;
  gap: 1.5rem;
}

.band-grid > section {
  padding: 0 1.75rem 2rem;
  border: var(--frame);
  border-radius: 3px;
  background: #FBF7EF;
  box-shadow: var(--drop);
}

/* Each panel opens with a hatched title strip, as in a parts list. */
.band-grid > section > .tag:first-child {
  margin: 0 -1.75rem 1.75rem;
  padding: 0.6rem 1.75rem;
  border-bottom: var(--frame);
  background: var(--hatch), #EFE6D6;
  color: var(--ink);
  font-weight: 700;
}

/* Who we are */
.areas {
  list-style: none;
  margin-top: 2rem;
}

.areas li {
  padding: 0.9rem 0;
  border-top: 1.5px dashed var(--ink-soft);
}

.areas p,
.entry-body p,
.opinions p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Herein: the middle column and the main picture on the page. */
.product .name {
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin: -0.25rem 0 0.9rem;
}

.product-lede {
  font-size: 1.1875rem;
  line-height: 1.5;
}

.demo {
  margin: 2rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.demo .tag {
  margin-bottom: 0.6rem;
}

/* The excerpt is cropped to a single line of the schedule, which sits at its
   foot so that a line can run from it down to the extracted result. */
.excerpt {
  border: var(--frame);
  border-radius: 3px;
  padding: 0.9rem 1rem 0;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}

.demo-meta {
  margin-bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.demo table {
  width: calc(100% + 2rem);
  margin: 0 -1rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.demo th {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: left;
  padding: 0 1.4rem 0.3rem;
}

.demo td {
  padding: 0.45rem 1.4rem;
  border-top: 1px solid var(--rule);
}

.demo td:first-child {
  position: relative;
  padding-left: calc(1.4rem + 1.65rem);
}

.demo th + th,
.demo td + td {
  text-align: right;
}

.demo tr.is-read td {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-wash);
}

.demo td .pin {
  position: absolute;
  z-index: 1;
  left: 1.4rem;
  top: 50%;
  margin: -0.575rem 0 0;
}

/* A leader line runs from the highlighted row's pin, past the rows below it,
   and out of the excerpt to the result. The excerpt crops it at its foot. */
.demo tr.is-read td:first-child::after {
  content: "";
  position: absolute;
  left: calc(1.4rem + 0.575rem - 1px);
  top: 50%;
  width: 2px;
  height: 30rem;
  background: var(--accent);
}

/* The numbered pins tie an extracted value to the line it came from. */
.pin {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  vertical-align: 0.05em;
}

/* The result: a small navy card, with the leader line arriving at its pin. */
.result {
  position: relative;
  max-width: 20rem;
  margin-top: 1.25rem;
  padding: 0.65rem 1rem 0.8rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--accent);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}

.result::before {
  content: "";
  position: absolute;
  left: calc(1.4rem + 0.575rem - 1px);
  top: calc(-1.25rem - 4px);
  width: 2px;
  height: calc(1.25rem + 4px);
  background: var(--accent);
}

.result-head {
  display: flex;
  align-items: center;
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-wash);
}

.result .pin {
  background: var(--paper);
  color: var(--accent);
}

.result dl div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.2rem 0;
  border-top: 1px dashed rgba(220, 227, 234, 0.4);
}

.result dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-wash);
}

.result dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* The name is the link to Herein's own site, underlined only on hover. */
.product .name a {
  color: inherit;
  text-decoration: none;
}

.product .name a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

.product .name .out {
  width: 0.32em;
  height: 0.32em;
  margin-left: 0.12em;
  vertical-align: 0.4em;
  stroke-width: 1.6;
}

/* Selected work: each entry shows its sector and title, and opens in place
   to a short description and a drawing. */
.entries details + details {
  border-top: 1.5px dashed var(--ink-soft);
}

.entries summary {
  position: relative;
  display: block;
  padding: 0.9rem 2rem 0.9rem 0;
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}

.entries summary::-webkit-details-marker {
  display: none;
}

.entries summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.entries summary .tag {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.6875rem;
}

.entry-title {
  display: block;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 650;
  font-size: 1.125rem;
  line-height: 1.3;
}

.entries summary:hover .entry-title {
  color: var(--accent);
}

.plus {
  position: absolute;
  top: 1.35rem;
  right: 0.2rem;
  width: 0.8rem;
  height: 0.8rem;
  transition: transform 160ms ease;
}

details[open] .plus {
  transform: rotate(45deg);
}

.entry-body {
  padding: 0 0 1.25rem;
}

.entry-fig {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding: 1rem;
  border: var(--frame);
  border-radius: 3px;
  background: var(--hatch), #EFE6D6;
}

.entry-fig .sketch {
  background: #EFE6D6;
}

.entry-fig .sketch {
  width: 100%;
  max-width: 12rem;
  height: auto;
}

/* ----- Closing row ----- */

/* The closing rows are framed in their own right, so they need no dividing
   rule above them. */
.thinking {
  padding: 3.5rem 0;
}

.home .contact .column::before {
  display: none;
}

.thinking-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.thinking-head a {
  color: var(--accent);
}

.opinions {
  list-style: none;
  counter-reset: opinion;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 3rem;
}

.opinions li {
  counter-increment: opinion;
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
  border: var(--frame);
  border-radius: 3px;
  background: #FBF7EF;
  box-shadow: 3px 3px 0 var(--ink);
}

/* Numbered like the steps of an instruction sheet, the badge sitting on the
   frame. */
.opinions li::before {
  content: counter(opinion);
  position: absolute;
  top: -0.95rem;
  left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
}

.opinions {
  margin-top: 1.25rem;
}

/* Each principle has a small drawing at the head of its card. */
.op-fig {
  display: flex;
  justify-content: center;
  margin: -1.5rem -1.25rem 1rem;
  padding: 1.6rem 1rem 0.9rem;
  border-bottom: var(--frame);
  background: #EFE6D6;
}

.op-fig .spec-fig {
  max-width: 12rem;
  margin: 0;
  padding: 0;
}

.contact-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1rem 3rem;
  padding: 1.75rem 2rem;
  border: var(--frame);
  border-radius: 3px;
  background: var(--accent-wash);
  box-shadow: var(--drop);
}

.contact-strip h2 {
  margin: 0;
}

.contact-strip p {
  margin: 0;
  color: var(--ink-soft);
}

.contact-strip .email {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 700;
  font-size: clamp(1.375rem, 4vw, 1.75rem);
}

/* ----- Narrower screens ----- */

/* Tablets and narrow desktops: the headline sits above the panels, and the
   three columns become a single column of readable width. */
@media (max-width: 64rem) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 14ch;
  }

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

  .band-grid {
    gap: 2rem;
  }

  .contact-strip {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 48rem) {
  .opinions {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Phones: the panels stack, since in two columns their captions get
   cramped. */
@media (max-width: 30rem) {
  .specimens {
    grid-template-columns: 1fr;
  }

  .spec:nth-child(even) {
    border-left: none;
  }

  .spec + .spec {
    border-top: var(--frame);
  }

  .spec-fig {
    max-width: 11rem;
  }
}

/* ===== Contact page ===== */

/* The arrow on links that leave the site is drawn rather than set, since
   Charter has no arrow of its own and the fallback glyph comes out thin and
   adrift of the word. */
.out {
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.2em;
  vertical-align: 0.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.masthead nav a[aria-current="page"] {
  color: var(--accent);
}

/* ===== Beliefs page ===== */

/* The beliefs are set out as a page of comic panels: each framed, shaded in
   dots or hatching as a printer would, with a drawing and a caption. They
   arrive one after another as the page loads. */
.beliefs-page .column,
.contact-page .column {
  max-width: calc(64rem + 2 * var(--gutter));
}

.comic-page h1 {
  margin-bottom: 2.5rem;
}

.comic {
  list-style: none;
  counter-reset: belief;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

/* An uneven grid, so it reads as a page rather than a table: wide and narrow
   panels alternate from row to row. */
.comic li:nth-child(1),
.comic li:nth-child(9) {
  grid-column: span 4;
}

.comic li:nth-child(2),
.comic li:nth-child(8) {
  grid-column: span 2;
}

.comic li:nth-child(3),
.comic li:nth-child(4),
.comic li:nth-child(5) {
  grid-column: span 2;
}

.comic li:nth-child(6),
.comic li:nth-child(7) {
  grid-column: span 3;
}

.comic li {
  counter-increment: belief;
}

.comic li,
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 15rem;
  padding: 2.75rem 1.25rem 1.25rem;
  border: var(--frame);
  border-radius: 3px;
  background:
    radial-gradient(circle, rgba(43, 35, 29, 0.2) 1px, transparent 1.5px) 0 0 / 7px 7px,
    #EFE6D6;
  box-shadow: var(--drop);
  animation: pop 460ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

.comic li:nth-child(3n + 2),
.objective {
  background: var(--hatch), #EFE6D6;
}

.comic li:nth-child(3n),
.panel-wide {
  background:
    radial-gradient(circle, rgba(36, 71, 107, 0.3) 1.1px, transparent 1.6px) 0 0 / 7px 7px,
    var(--accent-wash);
}

/* The panel number sits in an ink box in the top corner. */
.comic li::before {
  content: "No. " counter(belief);
}

.panel::before {
  content: attr(data-caption);
}

.comic li::before,
.panel::before {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.3rem 0.65rem;
  border-bottom-right-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-fig {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  margin: 0 auto;
}

.panel-fig rect,
.panel-fig circle {
  fill: var(--paper);
}

.panel-fig .dot {
  fill: var(--accent);
  stroke: var(--accent);
}

.panel-fig .thin {
  stroke-width: 1.2;
  stroke-dasharray: 2 3;
}

.panel-fig text {
  fill: var(--ink);
  stroke: none;
  font-family: var(--mono);
  font-size: 10px;
  text-anchor: middle;
}

/* The belief itself, in a caption box. Every other one is a speech bubble,
   its tail pointing up at the drawing. */
.bubble {
  position: relative;
  padding: 0.75rem 1rem;
  border: var(--frame);
  border-radius: 3px;
  background: #FBF7EF;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.comic li:nth-child(even) .bubble,
.bubble.speech {
  border-radius: 1.25rem;
}

.comic li:nth-child(even) .bubble::after,
.bubble.speech::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 2rem;
  width: 14px;
  height: 14px;
  border-top: var(--frame);
  border-left: var(--frame);
  background: #FBF7EF;
  transform: rotate(45deg);
}

main .bubble {
  color: var(--ink);
  font-size: 1.25rem;
}

.comic li:hover .bubble {
  color: var(--accent);
}

/* ----- The contact page, as a mission briefing ----- */

.mission {
  counter-reset: done;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.panel-wide {
  grid-column: 1 / -1;
  min-height: 0;
}

.panel-wide .panel-fig {
  max-width: 9rem;
}

.panel .ring {
  fill: none;
  stroke: var(--accent);
}

.intro .mission-head {
  grid-column: 1 / -1;
  margin: 1.5rem 0 0.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.objective {
  cursor: pointer;
  animation-delay: calc(var(--i, 2) * 90ms);
}

.objective .bubble {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
}

/* The tick box is drawn to match: an ink square that takes a navy tick. */
.tick {
  flex: none;
  appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  border: var(--frame);
  border-radius: 2px;
  background: var(--paper) center / 80% no-repeat;
  cursor: pointer;
}

.tick:checked {
  counter-increment: done;
  background-color: var(--accent-wash);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4.5' fill='none' stroke='%2324476B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tick:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.objective:has(.tick:checked) .bubble {
  color: var(--accent);
}

.finale {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
  padding-top: 3rem;
  overflow: hidden;
}

.intro .progress {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.progress::after {
  content: "Objectives " counter(done) " of 3";
}

.intro .send {
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.send a {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: var(--frame);
  border-radius: 3px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-weight: 700;
  font-size: clamp(1.125rem, 3.5vw, 1.5rem);
  text-decoration: none;
  box-shadow: var(--drop);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.send a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.send a:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* Once all three objectives are ticked, the last panel takes a tick too. */
.stamp {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  fill: var(--accent-wash);
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms ease, transform 260ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

.mission:not(:has(.tick:not(:checked))) .stamp {
  opacity: 1;
  transform: none;
}

@keyframes pop {
  0% { opacity: 0; transform: scale(0.9) rotate(-1.5deg); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .comic li,
  .panel { animation: none; }
}

@media (max-width: 52rem) {
  .comic {
    grid-template-columns: 1fr 1fr;
  }

  .comic li:nth-child(n) {
    grid-column: span 1;
  }

  .comic li:nth-child(1),
  .comic li:nth-child(6),
  .comic li:nth-child(9) {
    grid-column: span 2;
  }
}

@media (max-width: 44rem) {
  .mission {
    grid-template-columns: 1fr;
  }

  .stamp {
    top: 0.6rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
  }
}

@media (max-width: 34rem) {
  .comic {
    grid-template-columns: 1fr;
  }

  .comic li:nth-child(n) {
    grid-column: auto;
    min-height: 0;
  }
}

/* ===== Footer ===== */

footer {
  padding: 0 0 3rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

footer p + p {
  margin-top: 0;
}

footer .column::before {
  margin-bottom: 2rem;
}

footer .name {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

footer a {
  color: inherit;
}

@media (max-width: 40rem) {
  :root {
    --gutter: 1.25rem;
  }

  body {
    font-size: 1.125rem;
  }

  .wordmark img {
    height: 34px;
  }

  .intro p {
    font-size: 1.1875rem;
  }
}
