:root {
  color-scheme: light dark;
  --background: #fbfaf7;
  --paper: #ffffff;
  --paper-hover: #faf6eb;
  --text: #11110f;
  --muted: #6c6961;
  --faint: #918b7d;
  --line: #e7e1d5;
  --line-strong: #d6ccb8;
  --gold: #b9943f;
  --gold-soft: #efe3bf;
  --shadow: 0 24px 60px rgba(26, 24, 20, 0.04);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #11100e;
    --paper: #191816;
    --paper-hover: #211f19;
    --text: #f4f0e8;
    --muted: #b9b1a2;
    --faint: #918878;
    --line: #2a2721;
    --line-strong: #3a352b;
    --gold: #d9bd73;
    --gold-soft: #3a321f;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(185, 148, 63, 0.08), transparent 35rem),
    var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

::selection {
  background: var(--gold-soft);
  color: var(--text);
}

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.8rem;
  left: 0.8rem;
  padding: 0.55rem 0.75rem;
  background: var(--text);
  color: var(--background);
  font-size: 0.9rem;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

main,
.site-header {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
}

.home-hero {
  min-height: 92svh;
  display: grid;
  align-content: center;
  padding-block: 7rem 5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 680;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
h3,
blockquote {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

.home-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(4.25rem, 13vw, 10.25rem);
  line-height: 0.91;
}

.home-hero h1 span,
.site-mark span {
  color: var(--gold);
}

.home-hero h1 span {
  font-size: 0.38em;
  vertical-align: 1.1em;
}

.thesis {
  max-width: 18ch;
  margin: 2.4rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 4.9rem);
  line-height: 1.02;
}

.lede {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.5vw, 1.35rem);
}

.home-section {
  padding-block: clamp(4.5rem, 10vw, 9rem);
  border-top: 1px solid var(--line);
}

.narrow {
  max-width: 760px;
  margin-inline: auto;
}

.section-heading {
  max-width: 720px;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.home-section h2 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 5.2rem);
  line-height: 1.03;
}

.narrow h2 {
  max-width: 13ch;
}

.prose {
  margin-top: 2.4rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
}

.prose p {
  max-width: 39rem;
  margin: 0;
}

.prose p + p {
  margin-top: 1rem;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.document-card {
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  padding: clamp(1.35rem, 2.7vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.document-card:hover {
  background: var(--paper-hover);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.document-card span {
  margin-bottom: auto;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
}

.document-card h3 {
  margin: 3rem 0 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.12;
}

.document-card p {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.workflow li {
  position: relative;
  display: grid;
  min-height: 8.25rem;
  align-content: end;
  padding: 0 0.85rem 1rem 0;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(0.82rem, 1vw, 0.98rem);
  line-height: 1.35;
}

.workflow li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0.9rem;
  left: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.workflow li::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px var(--gold-soft);
}

.beliefs ul,
.projects ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.beliefs ul {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.beliefs li {
  padding: 1.35rem 1.5rem 1.35rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.6vw, 2.35rem);
  line-height: 1.12;
}

.projects ul {
  max-width: 760px;
  border-top: 1px solid var(--line);
}

.projects li {
  display: flex;
  align-items: center;
  min-height: 4.7rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.85rem);
  line-height: 1.15;
}

.projects li:last-child {
  color: var(--muted);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
}

.closing {
  min-height: 76svh;
  display: grid;
  align-content: center;
  padding-block: 5rem;
  border-top: 1px solid var(--line);
}

.closing blockquote {
  max-width: 980px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.98;
}

.closing blockquote p,
.closing > p {
  margin: 0;
}

.closing blockquote p + p {
  margin-top: 0.3em;
  color: var(--muted);
}

.closing > p {
  margin-top: 2rem;
  color: var(--muted);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.2rem;
}

.site-mark {
  font-family: var(--serif);
  font-size: 1.12rem;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.95rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-header nav a {
  text-decoration-color: transparent;
  text-underline-offset: 0.28em;
}

.site-header nav a:hover {
  color: var(--text);
  text-decoration-color: var(--gold);
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration-color: var(--gold);
}

.chapter-shell {
  width: min(100% - 2rem, 980px);
  padding-block: clamp(3rem, 7vw, 7rem) 5rem;
}

.chapter {
  max-width: 740px;
  margin-inline: auto;
}

.chapter-header {
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.chapter-header h1 {
  margin: 0;
  font-size: clamp(3.15rem, 8vw, 7rem);
  line-height: 0.96;
}

.chapter-header p:last-child {
  max-width: 36rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
}

.chapter-body {
  color: var(--text);
}

.chapter-body h2,
.related-documents h2 {
  margin: 3.8rem 0 1.2rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.chapter-body h3 {
  margin: 2.8rem 0 0.9rem;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.16;
}

.chapter-body p {
  margin: 0;
  color: var(--text);
}

.chapter-body p + p,
.chapter-body ul + p,
.chapter-body blockquote + p,
.chapter-body .chapter-flow + p {
  margin-top: 1.05rem;
}

.chapter-body h2 + p,
.chapter-body h3 + p {
  margin-top: 0;
}

.chapter-body ul {
  margin: 1.1rem 0 1.7rem;
  padding-left: 1.15rem;
}

.chapter-body li {
  padding-left: 0.35rem;
}

.chapter-body li + li {
  margin-top: 0.35rem;
}

.chapter-body blockquote {
  margin: 2.4rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--gold);
  color: var(--text);
  font-size: clamp(1.42rem, 2.4vw, 2.15rem);
  line-height: 1.28;
}

.chapter-body blockquote p {
  color: inherit;
}

.chapter-body blockquote p + p {
  margin-top: 0.4rem;
}

.chapter-body hr {
  width: 5rem;
  height: 1px;
  margin: 2.8rem 0;
  background: var(--line-strong);
  border: 0;
}

.chapter-flow {
  display: grid;
  gap: 0;
  margin: 1.7rem 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: chapter-step;
  border-top: 1px solid var(--line);
}

.chapter-flow li {
  position: relative;
  min-height: 3.7rem;
  display: flex;
  align-items: center;
  padding: 0.85rem 0 0.85rem 3.5rem;
  border-bottom: 1px solid var(--line);
}

.chapter-flow li::before {
  counter-increment: chapter-step;
  content: counter(chapter-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.plain-fence {
  margin: 1.7rem 0 2rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--gold);
  color: var(--muted);
}

.related-documents {
  max-width: 740px;
  margin: clamp(4rem, 8vw, 7rem) auto 0;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}

.related-documents h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
}

.related-documents div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.related-documents a {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}

.related-documents a:hover {
  background: var(--paper-hover);
  border-color: var(--line-strong);
}

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 800ms ease,
    transform 800ms ease;
}

html.js .reveal.is-visible,
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 860px) {
  main,
  .site-header,
  .chapter-shell {
    width: min(100% - 1.4rem, 1120px);
  }

  .home-hero {
    min-height: 86svh;
    padding-block: 5rem 4rem;
  }

  .home-hero h1 {
    font-size: clamp(3.5rem, 18vw, 6.5rem);
  }

  .document-grid,
  .beliefs ul,
  .related-documents div {
    grid-template-columns: 1fr;
  }

  .document-card {
    min-height: 15rem;
  }

  .workflow {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .workflow li {
    min-height: 5.3rem;
    padding: 1.25rem 0 1.25rem 3.4rem;
    border-top: 0;
    border-left: 1px solid var(--line-strong);
    align-content: center;
  }

  .workflow li::before {
    top: 50%;
    left: 1.3rem;
    transform: translateY(-50%);
  }

  .workflow li::after {
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .site-header nav {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  body {
    line-height: 1.65;
  }

  .home-section {
    padding-block: 4rem;
  }

  .home-section h2 {
    max-width: 12ch;
  }

  .beliefs li,
  .projects li {
    padding-right: 0;
  }

  .chapter-header h1 {
    font-size: clamp(2.75rem, 16vw, 4.6rem);
  }

  .chapter-body h2 {
    font-size: clamp(1.9rem, 10vw, 2.7rem);
  }

  .closing blockquote {
    font-size: clamp(2.5rem, 13vw, 4.5rem);
  }
}
