:root {
  --wall: #c5cbc3;
  --wall-ink: #1a1714;
  --sheet: #f4f1e7;
  --ink: #1a1714;
  --ink-soft: #3e342c;
  --rule: #d4cec1;
  --signal: #f5c518;
  --signal-deep: #dfb000;
  --stamp: #8e1c14;
  --shadow: 8px 18px 36px rgba(26, 23, 20, 0.18);
  --font-display: "Commissioner", sans-serif;
  --font-body: "Atkinson Hyperlegible", sans-serif;
  --measure: 68ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #2a2e2a;
    --wall-ink: #f4f1e7;
    color-scheme: dark;
  }
}

@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: auto;
  scrollbar-color: color-mix(in srgb, var(--ink) 45%, var(--wall)) var(--wall);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wall);
  color: var(--wall-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--signal);
  color: var(--ink);
}

:focus {
  outline: none;
}

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

a.skip:link,
a.skip:visited {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--signal);
  color: var(--ink);
  padding: 0.65rem 1rem;
  z-index: 5;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
}

a.skip:focus {
  transform: none;
}

.sheet {
  color-scheme: light;
  background: var(--sheet);
  color: var(--ink);
  max-width: 68rem;
  margin: 0.75rem auto 2.5rem;
  position: relative;
  box-shadow: var(--shadow);
}

.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  top: -0.7rem;
  width: 4.5rem;
  height: 1.35rem;
  background: color-mix(in srgb, var(--sheet) 62%, white);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  z-index: 2;
}

.sheet::before {
  left: 1.4rem;
  transform: rotate(-3deg);
}

.sheet::after {
  right: 1.4rem;
  transform: rotate(2.5deg);
}

.mast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.85rem 1.25rem 0.7rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.2rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.menu {
  display: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.9rem;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.menu:hover {
  background: var(--signal);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  text-underline-offset: 0.22em;
}

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

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--signal-deep);
  text-underline-offset: 0.28em;
}

.band {
  background: var(--signal);
  color: var(--ink);
  padding: 1rem 1.25rem 1.05rem;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.98;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.55rem);
  margin: 0 0 0.7rem;
  max-width: 16ch;
}

.lede {
  margin: 0;
  max-width: var(--measure);
  font-size: 1.125rem;
  line-height: 1.45;
}

.sheet-body {
  padding: 0.35rem 1.25rem 1.6rem;
}

.blanks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  margin-top: 0.35rem;
}

.blank {
  border-top: 1px solid var(--rule);
  padding: 0.4rem 0 0.2rem;
  min-width: 0;
}

.blank-wide {
  grid-column: 1 / -1;
}

.blank label,
.check span {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1rem;
}

input,
select,
textarea {
  scroll-margin-bottom: 5.5rem;
  width: 100%;
  margin-top: 0.2rem;
  border: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  min-height: 44px;
  padding: 0.35rem 0;
  caret-color: var(--ink);
}

textarea {
  min-height: 4.25rem;
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%231a1714' stroke-width='1.75' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.1rem center;
  background-size: 1rem;
  padding-right: 1.6rem;
}

::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

.js .is-other {
  display: none;
}

.js .is-other.is-open {
  display: block;
}

.field-error {
  color: var(--stamp);
  margin: 0.3rem 0 0;
  font-size: 0.98rem;
}

.blank.is-invalid input,
.blank.is-invalid select,
.blank.is-invalid textarea {
  border-bottom-color: var(--stamp);
  border-bottom-width: 2px;
}

.action {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--ink);
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.action:hover {
  background: var(--signal-deep);
}

.action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.fine,
.noscript {
  max-width: var(--measure);
  color: var(--ink);
  margin: 0.75rem 0 0;
}

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

a:link,
a:visited {
  color: inherit;
  text-underline-offset: 0.18em;
}

.sheet a {
  color: var(--ink);
}

.prose {
  max-width: var(--measure);
}

.prose p,
.prose li {
  margin: 0 0 0.9rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  margin: 3.25rem 0 0.8rem;
  max-width: 20ch;
}

h3 {
  font-size: 1.35rem;
  margin: 1.6rem 0 0.45rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 72ch;
}

.steps li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.75rem;
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
}

.steps b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.rows {
  margin: 0;
  max-width: 46rem;
}

.rows div {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.75rem 1.25rem;
  border-top: 1px solid var(--rule);
  padding: 0.85rem 0;
  align-items: baseline;
}

.rows dt {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rows dd {
  margin: 0;
}

.fee dd {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.price {
  font-size: 1.45rem;
}

.specimen {
  position: relative;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 0.4rem 0 0.2rem;
  max-width: 40rem;
}

.stamp {
  border: 3px solid var(--stamp);
  color: var(--stamp);
  width: min(16rem, 100%);
  margin: 1rem 0 0 auto;
  padding: 0.45rem 0.7rem 0.55rem;
  text-align: center;
  transform: rotate(-7deg);
}

.stamp p {
  margin: 0.25rem 0 0;
}

.stamp a {
  color: var(--stamp);
}

.stamp-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.25rem;
  margin: 0;
}

.stamp.is-set {
  animation: stamp-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: rotate(-16deg) scale(1.28);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: rotate(-7deg) scale(1);
  }
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-top: 0.85rem;
}

.check input {
  width: 1.5rem;
  height: 1.5rem;
  min-height: 1.5rem;
  margin-top: 0.15rem;
  accent-color: var(--ink);
  flex: 0 0 auto;
}

.check span {
  font-weight: 600;
}

.close {
  margin-top: 3rem;
  padding-top: 0.2rem;
}

.email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}

.colophon {
  max-width: 68rem;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
  color: var(--wall-ink);
}

.colophon p {
  margin: 0 0 0.45rem;
  max-width: var(--measure);
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.legal-nav a {
  color: var(--wall-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
}

.todo {
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  max-width: var(--measure);
}

@media (max-width: 760px) {
  .menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.4rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding-left: 0;
  }

  .blanks,
  .rows div,
  .steps li {
    grid-template-columns: 1fr;
  }

  .sheet {
    margin: 0.85rem 0.7rem 1.5rem;
  }

  button.action {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.65rem;
    width: auto;
    margin-top: 0;
    z-index: 4;
    box-shadow: 0 10px 24px rgba(26, 23, 20, 0.22);
  }

  body {
    padding-bottom: 5.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp.is-set {
    animation: none;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 2.15rem;
  }
}
