@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------------------
   Tokens
   One accent, one job: it marks the index, the numerals that number the work
   and the links that leave the page. Everything else is ink on paper.
--------------------------------------------------------------------------- */

:root {
  --paper: #faf8f4;
  --ink: #17160f;
  --muted: #524f45;
  --rule: #dcd7cb;
  --accent: #b03a22;

  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step-0: 1.0625rem; /* 17 px body */
  --step-1: 1.375rem;
  --step-2: clamp(1.5rem, 2.4vw, 1.875rem);
  --step-3: clamp(1.75rem, 3.4vw, 2.5rem);
  --step-4: clamp(2.75rem, 9vw, 5.75rem);

  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --max: 1160px;
  --measure: 62ch;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111110;
    --ink: #edeae3;
    --muted: #b3aea6;
    --rule: #2b2a26;
    --accent: #f07a5f;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #3a3831;
    --rule: #8d887c;
    --accent: #8f2a12;
  }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root {
    --muted: #d6d1c8;
    --rule: #6b675e;
    --accent: #ffa48d;
  }
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */

*,
*::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(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

/* For text that only a screen reader needs: the link's destination, when the
   visible label is a project name and the link leaves for GitHub. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  transform: translateY(-200%);
  transition: transform 180ms var(--ease);
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8125rem;
  z-index: 10;
}

.skip:focus {
  transform: translateY(1rem);
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 9vw, 7.5rem);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-block-end: 1rem;
  border-bottom: 1px solid var(--rule);
}

.hero__title {
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
  margin-block-start: clamp(2rem, 4vw, 3.5rem);
  max-width: 14ch;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero__lead {
  margin-block-start: clamp(1.5rem, 2.5vw, 2rem);
  max-width: 46ch;
  font-size: clamp(1.125rem, 1.9vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.hero__lead em {
  font-style: normal;
  color: var(--muted);
}

.contact {
  margin-block-start: clamp(2.5rem, 4vw, 3.5rem);
}

.contact ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.contact li {
  min-width: 0;
}

.contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
  transition: border-color 180ms var(--ease);
}

.contact a:hover {
  border-color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Sections
--------------------------------------------------------------------------- */

.section {
  padding-block: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--rule);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-block-end: clamp(1.5rem, 3vw, 2.5rem);
}

.section__head h2 {
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section__head p {
  max-width: 44ch;
  color: var(--muted);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   The index
--------------------------------------------------------------------------- */

.index {
  counter-reset: entry;
}

.entry {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 15.5rem;
  grid-template-areas: "num body facts";
  column-gap: clamp(1.25rem, 3vw, 2.5rem);
  padding-block: clamp(2rem, 3.5vw, 3rem);
  border-top: 1px solid var(--rule);
}

.entry:last-child {
  border-bottom: 1px solid var(--rule);
}

.entry__num {
  grid-area: num;
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  transition: transform 180ms var(--ease);
}

.entry:hover .entry__num,
.entry:focus-within .entry__num {
  transform: translateX(4px);
}

.entry__body {
  grid-area: body;
}

.entry__title {
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}

.entry__link {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  /* 31 px of text at the smallest display size, padded to a 44 px target.
     The negative margin keeps the extra box out of the layout. */
  padding-block: 8px;
  margin-block: -8px;
}

.entry__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease);
}

.entry__link:hover::after,
.entry__link:focus-visible::after {
  transform: scaleX(1);
}

.entry__stack {
  margin-block-start: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.entry__desc {
  margin-block-start: 1rem;
  max-width: var(--measure);
  text-wrap: pretty;
}

.entry__desc code {
  font-family: var(--mono);
  font-size: 0.875em;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.entry__note {
  margin-block-start: 1rem;
  max-width: var(--measure);
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--rule);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.entry__note b {
  font-weight: 500;
  color: var(--ink);
}

.facts {
  grid-area: facts;
  align-self: start;
  display: grid;
  gap: 1rem;
}

.facts div {
  display: grid;
  gap: 0.25rem;
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   Toolkit
--------------------------------------------------------------------------- */

.toolkit {
  display: grid;
  gap: 0;
}

.toolkit div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.toolkit div:last-child {
  border-bottom: 1px solid var(--rule);
}

.toolkit dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-block-start: 0.25rem;
}

.toolkit dd {
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------------
   Record
--------------------------------------------------------------------------- */

.record {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: clamp(2rem, 4vw, 4rem);
}

.record h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-block-end: 1rem;
}

.record__list li + li {
  margin-block-start: 1.5rem;
  padding-block-start: 1.5rem;
  border-top: 1px solid var(--rule);
}

.record p {
  text-wrap: pretty;
}

.record .detail {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------------------------------------------------------------------------
   Contact
--------------------------------------------------------------------------- */

.closing {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(4.5rem, 9vw, 7.5rem);
}

.closing__mail {
  display: inline-block;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  word-break: break-word;
  padding-block: 8px;
  border-bottom: 2px solid var(--rule);
  transition: border-color 180ms var(--ease);
}

.closing__mail:hover {
  border-color: var(--accent);
}

.closing__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-block-start: 2.5rem;
}

.closing__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--rule);
  transition: border-color 180ms var(--ease);
}

.closing__links a:hover,
.closing__links a:focus-visible {
  border-color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Narrow
--------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .entry {
    grid-template-columns: 3rem minmax(0, 1fr);
    grid-template-areas:
      "num body"
      ". facts";
    row-gap: 1.75rem;
  }

  .facts {
    grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
    gap: 1rem 1.5rem;
  }
}

@media (max-width: 720px) {
  .toolkit div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .entry {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "num"
      "body"
      "facts";
    row-gap: 1rem;
  }

  .entry__num {
    font-size: 1.5rem;
  }
}

/* ---------------------------------------------------------------------------
   Motion
--------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  .entry:hover .entry__num,
  .entry:focus-within .entry__num {
    transform: none;
  }
}
