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

:root {
  --bg: #000000;
  --fg: #ffffff;
  --dim: rgba(255, 255, 255, 0.55);
  --rule: rgba(255, 255, 255, 0.16);
  --font: "EB Garamond", Garamond, "Adobe Garamond Pro", "Times New Roman", serif;
  --measure: 40rem;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  font-family: var(--font);
  /* an old-style serif thins out badly on a dark ground, so let the
     stems keep their weight instead of smoothing them away */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  width: min(100%, var(--measure));
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(2.5rem, 8vh, 5rem) 1.5rem 2rem;
}

/* short pages: sit the block in the middle of the viewport rather than
   leaving a void between the content and the footer */
main.centered {
  justify-content: center;
  padding-top: 1.5rem;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

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

/* ---------- marks ---------- */

.logo {
  color: var(--fg);
  font-size: clamp(2.4rem, 7.5vw, 4.5rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
}

.mark {
  display: inline-block;
  width: max-content;
  color: var(--fg);
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  margin-bottom: clamp(2.25rem, 6vh, 3.5rem);
  transition: opacity 140ms ease;
}

.mark:hover {
  opacity: 0.55;
}

/* ---------- prose ---------- */

.prose {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Garamond has a small x-height, so it needs more point size than a
   grotesque to read at the same apparent size. One body size per page. */
.prose p,
.items li {
  color: var(--fg);
  font-size: clamp(1.1rem, 2.1vw, 1.24rem);
  line-height: 1.58;
}

.prose a {
  color: var(--fg);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  opacity: 0.6;
}

/* ---------- document masthead ---------- */

.page-title {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.1;
  margin-bottom: 0.9rem;
}

/* a title with no kicker still needs air before the copy starts */
.page-title + .prose {
  margin-top: clamp(2rem, 5vh, 2.75rem);
}

.kicker {
  color: var(--dim);
  font-size: clamp(0.82rem, 1.4vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: clamp(2rem, 5vh, 2.75rem);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

/* ---------- section headings ---------- */

/* short-page section labels, sized to sit alongside the body rather than
   under it, and weighted up because tracked caps thin out on black */
.prose h2 {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  /* the flex gap on .prose already adds 1.2rem, so this stacks on top */
  margin-top: clamp(1.25rem, 3vh, 1.75rem);
}

/* long-form: real headings carry the hierarchy, so no rules needed */
.longform h2 {
  font-size: clamp(1.5rem, 3.2vw, 1.95rem);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.15;
  margin-top: clamp(1.5rem, 3.5vh, 2.25rem);
}

/* ---------- nav ---------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.75rem;
  margin-top: clamp(1.9rem, 5vh, 2.9rem);
}

.nav a {
  display: inline-flex;
  align-items: center;
  /* the text is small by design, so pad the hit area out to a thumb */
  min-height: 2.75rem;
  color: var(--dim);
  font-size: clamp(0.88rem, 1.5vw, 0.98rem);
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 140ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--fg);
}

/* ---------- lists ---------- */

.items {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  list-style: none;
  counter-reset: item;
}

.items li {
  display: grid;
  grid-template-columns: 2.35rem 1fr;
  align-items: baseline;
}

.items li::before {
  content: counter(item, decimal-leading-zero);
  counter-increment: item;
  color: var(--dim);
  font-size: 0.8em;
  letter-spacing: 0.06em;
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 2.5rem 1.5rem 1.75rem;
}

.tagline {
  color: var(--fg);
  font-size: clamp(0.88rem, 1.5vw, 0.98rem);
  font-weight: 500;
  letter-spacing: 0.13em;
}

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  color: var(--fg);
  font-size: clamp(0.82rem, 1.4vw, 0.9rem);
  letter-spacing: 0.04em;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 140ms ease;
}

.contact:hover {
  opacity: 1;
}
