@font-face {
  font-family: "Noto Serif Display";
  src: url("noto-serif-display-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #191309;
  --red: #a4250f;
  --rule: #413629;
  --paper: #fff6e6;
  --serif: "Noto Serif Display", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #ffe2c5;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: url("paper-grain.png"), radial-gradient(ellipse at 75% 38%, #ffead1, transparent 65%), #ffe2c5;
}

.page {
  width: 94%;
  max-width: 87.5rem;
  margin-inline: auto;
  padding-block: clamp(.75rem, 1.2vw, 1.25rem) clamp(2rem, 4vw, 4rem);
}

.masthead, .wordmark {
  display: flex;
  align-items: center;
}

.masthead {
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: clamp(.7rem, 1.1vw, 1.1rem);
  border-bottom: 2px solid var(--ink);
}

h1, h2, h3, .wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -.055em;
}

.wordmark {
  gap: .25em;
  font-size: clamp(1.8rem, 3.1vw, 2.9rem);
  line-height: 1.05;
}

.wordmark img {
  display: block;
  width: 1.42em;
  height: 1.27em;
  object-fit: contain;
}

.domain {
  font: 600 clamp(.9rem, 1.8vw, 1.6rem)/1.2 var(--mono);
}

.invoice {
  --rail: clamp(1.65rem, 3.5vw, 3.25rem);
  --hole: clamp(.24rem, .53vw, .48rem);
  --pitch: clamp(1.75rem, 3.3vw, 3rem);
  position: relative;
  display: grid;
  grid-template-columns: .93fr 1.07fr;
  align-items: stretch;
  margin: clamp(1.7rem, 2.65vw, 2.6rem) -.45% clamp(2.4rem, 3.6vw, 3.4rem);
  padding: clamp(1.3rem, 2vw, 1.9rem) var(--rail);
  border-radius: .65rem;
  background: url("paper-grain.png"), linear-gradient(105deg, #fff9ee, var(--paper) 68%, #fff9ec);
  box-shadow: 0 3px 2px #7e55332e, 0 7px 10px -5px #70502c6b;
}

/* The two perforated margins are decoration. They take no space away from the text columns. */
.invoice::before, .invoice::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: var(--rail);
  pointer-events: none;
  background-image: radial-gradient(circle at center, #e1bc96 0, #efd1af calc(var(--hole) - 1.5px), #bf9f7c var(--hole), transparent calc(var(--hole) + .6px));
  background-size: 100% var(--pitch);
  background-repeat: repeat-y;
  background-position: center center;
}

.invoice::before { left: 0; border-right: 1px dashed #ab9b83; }
.invoice::after { right: 0; border-left: 1px dashed #ab9b83; }

.invoice-title, .invoice-details {
  min-width: 0;
  container-type: inline-size;
  align-content: center;
  padding: clamp(.7rem, 1.3vw, 1.25rem) clamp(1.2rem, 2.65vw, 2.6rem);
}

.invoice-title { border-right: 1px dashed #7c6c54; }

h1 {
  font-size: clamp(2.2rem, 6.1vw, 5.55rem);
  font-size: clamp(2rem, 14.7cqi, 5.55rem);
  line-height: 1.01;
  letter-spacing: -.073em;
}

h1 span { display: block; }

.invoice p, .services p { margin: 0; }

.invoice p {
  font-size: clamp(1.12rem, 2.04vw, 1.88rem);
  letter-spacing: -.026em;
  text-wrap: pretty;
  line-height: 1.26;
}

.gateway {
  display: block;
  margin-top: .45em;
  color: var(--red);
  font: 700 clamp(1.12rem, 2.8vw, 2.6rem)/1.22 var(--mono);
  font-size: clamp(1rem, 7.05cqi, 2.6rem);
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

h2 {
  padding-bottom: .24em;
  font-size: clamp(2.8rem, 5.1vw, 4.75rem);
  line-height: 1.06;
}

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  border-block: 2px solid var(--rule);
}

.services li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.25rem, 2.35vw, 2.2rem) clamp(1.1rem, 2.7vw, 2.5rem) clamp(1.2rem, 1.85vw, 1.8rem) .15rem;
}

.services li:nth-child(even) { padding-inline: clamp(1.1rem, 2.7vw, 2.5rem) .15rem; }
.services li:nth-child(n+3) { border-top: 1px solid var(--rule); }

.services li:nth-child(even)::before {
  content: "";
  position: absolute;
  inset: 1.1rem auto 1.1rem 0;
  border-left: 1px solid var(--rule);
}

h3 {
  margin-bottom: .15em;
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1.08;
}

.services p {
  margin-bottom: .45em;
  font-size: clamp(1.125rem, 1.94vw, 1.78rem);
  letter-spacing: -.027em;
  line-height: 1.25;
  max-width: 39ch;
}

.services a {
  display: inline-flex;
  align-items: center;
  gap: .24em;
  min-height: 2.75rem;
  margin-top: auto;
  color: var(--red);
  font: 700 clamp(1.12rem, 2.05vw, 1.9rem)/1.25 var(--mono);
  letter-spacing: -.043em;
  text-decoration: none;
}

.arrow {
  position: relative;
  flex: none;
  width: .48em;
  height: .48em;
  margin-inline: .12em;
  border-top: .09em solid currentColor;
  border-right: .09em solid currentColor;
}

.arrow::after {
  content: "";
  position: absolute;
  top: -.045em;
  right: -.045em;
  width: .60em;
  border-top: .09em solid currentColor;
  transform-origin: right center;
  transform: rotate(-45deg);
}
.services a:hover, .services a:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.services a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }

@media (max-width: 52rem) {
  .page { width: 91%; }
  .invoice { grid-template-columns: 1fr; }
  .invoice-title, .invoice-details { padding: 1.15rem clamp(.95rem, 4vw, 2rem); }
  .invoice-title { border: 0; }
  .invoice-details { border-top: 1px dashed #a49379; }
  h1 { font-size: clamp(2.15rem, 14cqi, 3.9rem); }
  .gateway { font-size: clamp(1rem, 7cqi, 1.65rem); }
}

@media (max-width: 38rem) {
  .page { padding-top: .85rem; }
  .domain { display: none; }
  .invoice { margin-top: 1.5rem; margin-bottom: 2rem; padding-block: .35rem; }
  .invoice-title, .invoice-details { padding-block: 1.25rem; }
  h2 { font-size: 2.6rem; }
  .services { grid-template-columns: 1fr; }
  .services li, .services li:nth-child(even) { padding: 1.25rem .1rem 1rem; }
  .services li + li { border-top: 1px solid var(--rule); }
  .services li:nth-child(even)::before { display: none; }
  h3 { font-size: clamp(2rem, 7.7vw, 2.5rem); }
  .services p { margin-bottom: .2rem; }
}

@media (max-width: 22rem) {
  .invoice { --rail: 1rem; }
  .invoice-title, .invoice-details { padding-inline: .7rem; }
  h1 { font-size: clamp(1.8rem, 14cqi, 2.25rem); }
}

@media (forced-colors: active) {
  .invoice { border: 1px solid CanvasText; }
  .services a { text-decoration: underline; }
}
