/* ==========================================================================
   base — reset, type, and the two layout primitives
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* Focus is visible everywhere, in patina, and it is never removed. A page
   about a craft that has to be got right the first time should not make
   keyboard users guess where they are. */
:focus-visible {
  outline: 2px solid var(--patina);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--patina);
  color: var(--shell);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--ink);
  color: var(--shell);
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ── layout ─────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.sec {
  padding-block: var(--sec);
  position: relative;
  /* The bar is fixed and 3.65rem tall; without this, every in-page link and
     every browser restore lands with the section heading underneath it. */
  scroll-margin-top: 4.6rem;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ── type ───────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  font-family: var(--f-display);
  line-height: 1.02;
  letter-spacing: -0.012em;
}

h1 {
  font-size: var(--t-hero);
}
h2 {
  font-size: var(--t-h2);
}
h3 {
  font-size: var(--t-h3);
  line-height: 1.12;
}

p {
  margin: 0 0 1.05em;
  max-width: 62ch;
}
p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  max-width: 54ch;
  color: var(--ink-2);
}

.meta {
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand);
}

.num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

a {
  color: var(--patina);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.3s var(--settle);
}
a:hover {
  color: var(--ink);
}

em {
  font-style: italic;
}

.eq {
  font-family: var(--f-mono);
  font-size: 0.94em;
  background: var(--patina-wash);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  white-space: nowrap;
}

/* ── reveals ────────────────────────────────────────────────────────────
   One effect, used everywhere, and it is a rise rather than a fade-and-scale.
   Anything more elaborate on nine sections becomes the thing the page is
   about, and the thing this page is about is in a canvas. */

.rise {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.75s var(--settle),
    transform 0.75s var(--settle);
}
.rise.in {
  opacity: 1;
  transform: none;
}
.rise[data-d='1'] {
  transition-delay: 0.07s;
}
.rise[data-d='2'] {
  transition-delay: 0.14s;
}
.rise[data-d='3'] {
  transition-delay: 0.21s;
}

@media (prefers-reduced-motion: reduce) {
  .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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