/* Heterodox: one printed page. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-opsz.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f1ea;
  --ink: #121a26;
  --ink-soft: #464e5b;  /* 7.4:1 on paper */
  --accent: #b83f1c;    /* 4.9:1 on paper */
  --rule: #cfc8b9;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 44rem; /* ~65–70 characters of body text */
  --gutter: 1.25rem;
  --space: clamp(3.5rem, 2.5rem + 5vw, 6.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem); /* 18px → 21px */
  line-height: 1.55;
  font-optical-sizing: auto;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p,
h1,
h2 {
  margin: 0;
}

/* Links */

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

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -10rem;
  z-index: 1;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Page column */

.masthead,
main,
.colophon {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead {
  padding-top: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.wordmark a {
  color: inherit;
  text-decoration: none;
}

/* Top */

.top {
  padding-top: clamp(3rem, 2rem + 6vw, 7rem);
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.125rem, 1.35rem + 3.6vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.lede {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.top .lede + p {
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 3px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 120ms ease;
}

.button:hover {
  background: #9c3416;
}

/* Sections */

main > section + section {
  margin-top: var(--space);
}

h2 {
  margin-bottom: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

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

/* The problem: one figure */

.problem .stat {
  display: grid;
  gap: 0.25rem;
  margin-top: 2.25rem;
  align-items: start;
}

.stat-figure {
  font-family: var(--serif);
  font-size: clamp(5.5rem, 3.5rem + 9vw, 9.5rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums;
  color: var(--accent);
}

.stat-text {
  max-width: 24em;
}

.problem .source {
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (min-width: 40em) {
  .problem .stat {
    grid-template-columns: auto 1fr;
    gap: 1.75rem;
    align-items: center;
  }
}

/* The offer: the centrepiece */

.offer-text {
  font-size: clamp(1.625rem, 1.15rem + 2.1vw, 2.625rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.008em;
  text-wrap: pretty;
}

/* Get in touch */

.contact:focus {
  outline: none;
}

.contact .contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

.address {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-family: var(--sans);
  font-size: 1.0625rem;
}

.address-text {
  -webkit-user-select: all;
  user-select: all;
}

.copy {
  min-height: 2.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--ink-soft);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.copy[hidden] {
  display: none;
}

.copy:hover {
  border-color: var(--ink);
}

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

/* Who runs it */

.runs-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.portrait,
.portrait img {
  display: block;
  width: 112px;
  height: 112px;
  flex: none;
  border-radius: 6px;
}

.portrait img {
  object-fit: cover;
  filter: grayscale(1);
}

@media (min-width: 40em) {
  .runs-body {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.75rem;
  }
}

/* Footer */

.colophon {
  margin-top: var(--space);
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.colophon > p:first-child {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink);
}

.colophon p + p {
  margin-top: 0.5rem;
  max-width: 32em;
}

/* 404 */

.not-found main {
  padding-top: clamp(3rem, 2rem + 6vw, 7rem);
  padding-bottom: 6rem;
}

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

@media print {
  .skip-link,
  .copy,
  .button {
    display: none !important;
  }
}
