@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --desk: #3d22c9;
  --desk-deep: #2a1594;
  --desk-text: #d9d3ff;
  --paper: #fbfbfd;
  --ink: #15132e;
  --ink-soft: #4a4766;
  --rule: #c9c7d9;
  --stamp: #d81e5b;
  --stamp-text: #c2184f;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

html {
  background: var(--desk);
  scrollbar-color: var(--desk-text) var(--desk-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2.5rem 1.5rem 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Archivo", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  caret-color: var(--stamp);
}

::selection {
  background: var(--desk);
  color: #fff;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--stamp-text);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
}

.skip:focus {
  top: 0.5rem;
  outline-color: #fff;
}

/* The sheet */

.sheet {
  max-width: 65rem;
  margin: 0 auto;
  padding: 3rem 4rem 4rem;
  background: var(--paper);
  box-shadow:
    0 1px 2px rgb(15 8 70 / 0.3),
    0 28px 60px -24px rgb(15 8 70 / 0.65);
}

/* Letterhead */

.letterhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 6px double var(--ink);
}

.firm {
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
}

.firm:hover {
  color: var(--desk);
}

.letterhead address {
  font-style: normal;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: right;
  color: var(--ink-soft);
}

.letterhead address b {
  color: var(--ink);
  font-weight: 600;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-block;
  padding: 0.75rem 0;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.nav .mail {
  text-transform: none;
  letter-spacing: 0;
  font-stretch: 100%;
}

/* Opening of the letter */

.opening {
  position: relative;
  padding: 4.5rem 0 5rem;
}

.salutation {
  margin: 0 12rem 1.5rem 0;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

h1 {
  max-width: 17em;
  margin: 0;
  font-size: clamp(2.125rem, 5.6vw, 3.75rem);
  font-weight: 600;
  font-stretch: 88%;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.opening .lede {
  max-width: 36rem;
  margin: 1.75rem 0 0;
  font-size: 1.1875rem;
  color: var(--ink-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

.key {
  display: inline-block;
  padding: 0.9rem 1.5rem;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font-weight: 650;
  font-stretch: 108%;
  text-decoration: none;
  transition:
    background-color 160ms var(--ease),
    transform 120ms var(--ease);
}

.key:hover {
  background: var(--desk);
  color: #fff;
}

.key:active {
  transform: translateY(1px) scale(0.98);
}

.stamp {
  position: absolute;
  top: 2.25rem;
  right: 0;
  width: 10.5rem;
  height: 10.5rem;
  color: var(--stamp);
  transform: rotate(-9deg);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.stamp text {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-stretch: 112%;
  fill: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .stamp {
    animation: press 340ms var(--ease) 350ms backwards;
  }

  @keyframes press {
    from {
      opacity: 0;
      transform: rotate(-3deg) scale(1.4);
      filter: blur(3px);
    }
  }
}

/* Sections: heading hangs in the margin, content indented */

.sec {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0 3rem;
  padding: 1.75rem 0 4.5rem;
  border-top: 2px solid var(--ink);
}

h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.25;
  text-wrap: balance;
}

.sec > div > :first-child {
  margin-top: 0;
}

p {
  margin: 0 0 1em;
  max-width: 68ch;
}

/* Services: ruled rows, not cards */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rows li {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0.25rem 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.rows li:first-child {
  padding-top: 0;
  border-top: 0;
}

.rows li:last-child {
  padding-bottom: 0;
}

h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  font-stretch: 92%;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.rows p {
  margin: 0;
}

.rows .eg {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* Stages: one baseline, one scale */

.stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stage;
}

.stages li {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 0;
  counter-increment: stage;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ink);
  font-size: 0.9375rem;
}

.stages li::before {
  content: counter(stage);
  display: block;
  font-size: 2.5rem;
  font-weight: 300;
  font-stretch: 88%;
  line-height: 1;
  color: var(--desk);
}

.stages h3 {
  margin: 0.75rem 0 0.375rem;
  font-size: 1.125rem;
  font-stretch: 100%;
  letter-spacing: 0;
}

.stages p {
  margin: 0;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Plain list of commitments */

.terms {
  margin: 0;
  padding: 0;
  list-style: none;
}

.terms li {
  padding: 0.875rem 0;
  border-top: 1px solid var(--rule);
}

.terms li:first-child {
  padding-top: 0;
  border-top: 0;
}

.terms b {
  font-weight: 650;
}

/* Registration index */

.index {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  margin: 0;
  max-width: 44rem;
}

.index dt,
.index dd {
  margin: 0;
  padding: 0.625rem 0;
  border-top: 1px solid var(--rule);
}

.index dt:first-of-type,
.index dt:first-of-type + dd {
  padding-top: 0;
  border-top: 0;
}

.index dt {
  font-size: 0.875rem;
  color: var(--ink-soft);
  padding-right: 1.5rem;
}

.index dd {
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Sign-off */

.signoff {
  padding: 2.5rem 0 0;
  border-top: 2px solid var(--ink);
}

.signoff .ask {
  max-width: 20em;
  margin: 0 0 1.75rem;
  font-size: clamp(1.625rem, 3.6vw, 2.5rem);
  font-weight: 600;
  font-stretch: 88%;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.signoff .actions {
  margin-top: 0;
}

.signoff .ask span {
  display: block;
}

.signature {
  margin: 3.5rem 0 0;
  line-height: 1.45;
}

.signature .for {
  display: block;
  margin-bottom: 3rem;
  color: var(--ink-soft);
}

.signature b {
  display: block;
  font-weight: 650;
}

/* Legal pages */

.doc {
  padding: 3.5rem 0 0;
}

.doc h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.doc .updated {
  margin: 1rem 0 3.5rem;
  color: var(--ink-soft);
}

.doc .sec {
  padding-bottom: 3rem;
}

.doc ul {
  max-width: 68ch;
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.doc li {
  margin-bottom: 0.375em;
}

.doc li::marker {
  color: var(--desk);
}

/* Under the sheet */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: 65rem;
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  color: var(--desk-text);
  font-size: 0.875rem;
}

.foot p {
  margin: 0;
  max-width: none;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a {
  display: inline-block;
  padding: 0.5rem 0;
  color: #fff;
}

.foot a:hover {
  color: #fff;
  text-decoration-thickness: 2px;
}

.foot :focus-visible {
  outline-color: #fff;
}

@media (max-width: 60rem) {
  .sheet {
    padding: 2.25rem 2.25rem 3rem;
  }

  .sec {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 3.5rem;
  }

  .sec h2 {
    margin-bottom: 1.5rem;
  }

  .stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  body {
    padding: 0.75rem 0.75rem 0;
    font-size: 1rem;
  }

  .sheet {
    padding: 1.5rem 1.25rem 2.25rem;
  }

  .letterhead {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .letterhead address {
    text-align: left;
  }

  .nav ul {
    gap: 0 1.25rem;
  }

  .opening {
    padding: 2.5rem 0 3.5rem;
  }

  .salutation {
    margin-right: 8.25rem;
    min-height: 5.5rem;
    font-size: 1rem;
  }

  .stamp {
    top: 1rem;
    right: 0;
    width: 7.5rem;
    height: 7.5rem;
  }

  .opening .lede {
    font-size: 1.0625rem;
  }

  .rows li,
  .index {
    grid-template-columns: minmax(0, 1fr);
  }

  .index dt {
    padding-bottom: 0;
  }

  .index dd {
    padding-top: 0.125rem;
    border-top: 0;
  }

  .index dt:first-of-type + dd {
    padding-top: 0.125rem;
  }

  .stages {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .foot {
    padding: 1.5rem 0.5rem 2rem;
  }
}

@media print {
  html,
  body {
    background: #fff;
    padding: 0;
  }

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

  .nav,
  .foot,
  .actions {
    display: none;
  }
}
