:root {
  color-scheme: light;
  --ink: #172120;
  --muted: #596664;
  --paper: #f6f3ec;
  --paper-deep: #ebe5d9;
  --forest: #132b2c;
  --forest-soft: #234647;
  --accent: #c65332;
  --accent-soft: #f1d7ca;
  --rule: #d4cabb;
  --reading-width: 46rem;
  --shadow: 0 24px 70px rgb(25 35 32 / 10%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

a {
  color: #8e321c;
  text-decoration-color: rgb(142 50 28 / 35%);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  color: white;
  background: var(--accent);
  font: 700 0.85rem/1 system-ui, sans-serif;
  transform: translateY(-200%);
}

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

.hero {
  position: relative;
  overflow: hidden;
  color: #fffdf7;
  background: var(--forest);
  border-bottom: 0.45rem solid var(--accent);
}

.hero::after {
  position: absolute;
  right: -7rem;
  bottom: -9rem;
  width: 26rem;
  height: 26rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  box-shadow:
    0 0 0 3.5rem rgb(255 255 255 / 3%),
    0 0 0 7rem rgb(255 255 255 / 2%);
  content: "";
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 3rem, 76rem);
  margin-inline: auto;
  padding: clamp(4rem, 8vw, 7.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.eyebrow,
.hero-actions,
.occasion,
.publication-meta,
.toc,
.site-footer {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.eyebrow {
  margin: 0 0 1.2rem;
  color: #f5b69e;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.7rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.hero-thesis {
  max-width: 42rem;
  margin: 1.6rem 0 0;
  color: #fffdf7;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.28;
  text-wrap: balance;
}

.hero-support {
  max-width: 43rem;
  margin: 0.8rem 0 0;
  color: #bfd0cc;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.hero-actions,
.short-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.2rem;
  font: 750 0.82rem/1.15 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  text-decoration: none;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover {
  color: #fff;
  background: #aa3e23;
}

.button-secondary {
  color: #fffdf7;
  border-color: rgb(255 253 247 / 45%);
}

.button-secondary:hover {
  color: #fff;
  background: rgb(255 255 255 / 9%);
  border-color: #fffdf7;
}

.button-text {
  padding-inline: 0.35rem;
  color: #f5b69e;
}

.button-text:hover {
  color: #fff;
}

.button-github {
  color: #24292f;
  background: #f6f8fa;
  border-color: rgb(27 31 36 / 20%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%);
}

.button-github:hover {
  color: #24292f;
  background: #eef1f4;
}

.occasion {
  margin: 2.2rem 0 0;
  color: #f5b69e;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.publication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 0.55rem;
  color: #abc0bb;
  font-size: 0.78rem;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, var(--reading-width));
  gap: clamp(2.5rem, 6vw, 6rem);
  justify-content: center;
  width: min(100% - 3rem, 76rem);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 7rem) 0;
}

.toc {
  position: relative;
  font-size: 0.78rem;
  line-height: 1.35;
}

.toc-inner {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow: auto;
  padding: 1.2rem 1rem 1.2rem 0;
  border-top: 3px solid var(--accent);
  scrollbar-width: thin;
}

.toc-title {
  margin: 0 0 1rem;
  color: var(--forest);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

.toc li {
  margin: 0.2rem 0;
}

.toc a {
  display: block;
  padding: 0.25rem 0;
  color: var(--muted);
  text-decoration: none;
}

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

.toc-level-2 {
  padding-top: 0.75rem;
  font-weight: 750;
}

.toc-level-3 {
  padding-left: 0.75rem;
}

.toc-level-4 {
  padding-left: 1.5rem;
  font-size: 0.72rem;
}

main {
  min-width: 0;
}

article > :first-child {
  margin-top: 0;
}

article p {
  margin: 0 0 1.25em;
}

article h2,
article h3,
article h4 {
  position: relative;
  color: var(--forest);
  text-wrap: balance;
}

article h2 {
  margin: 0 0 2rem;
  font: 800 clamp(1rem, 2vw, 1.2rem)/1.2 system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

article h3 {
  margin: 4.8rem 0 1.6rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  line-height: 1.08;
}

article hr + h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

article h4 {
  margin: 3rem 0 1rem;
  font: 780 clamp(1.05rem, 2vw, 1.3rem)/1.3 system-ui, sans-serif;
  letter-spacing: -0.015em;
}

.heading-link {
  margin-left: 0.35em;
  color: var(--accent);
  font: 500 0.6em/1 system-ui, sans-serif;
  text-decoration: none;
  opacity: 0;
}

h2:hover .heading-link,
h3:hover .heading-link,
h4:hover .heading-link,
.heading-link:focus {
  opacity: 1;
}

article blockquote {
  position: relative;
  margin: 2.3rem 0;
  padding: 1.2rem 1.35rem 1.25rem 1.6rem;
  color: var(--forest);
  background: linear-gradient(90deg, var(--accent-soft), rgb(241 215 202 / 25%));
  border-left: 0.3rem solid var(--accent);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.45;
}

article blockquote p {
  margin: 0;
}

article hr {
  width: 4.5rem;
  margin: 4.5rem 0;
  border: 0;
  border-top: 0.3rem solid var(--accent);
}

article code {
  padding: 0.12em 0.35em;
  color: #672615;
  background: #eee1d6;
  border-radius: 0.2rem;
  font-size: 0.88em;
}

.credits {
  color: var(--muted);
  font: 0.85rem/1.55 system-ui, sans-serif;
}

.short-hero {
  color: #fffdf7;
  background: var(--forest);
  border-bottom: 0.45rem solid var(--accent);
}

.short-hero-inner {
  width: min(100% - 3rem, var(--reading-width));
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.wordmark {
  display: inline-block;
  margin-bottom: 3rem;
  color: #bfd0cc;
  font: 750 0.75rem/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark:hover {
  color: #fff;
}

.short-hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.short-deck {
  max-width: 38rem;
  margin: 1.3rem 0 0;
  color: #dce8e4;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  line-height: 1.4;
}

.short-main {
  width: min(100% - 3rem, var(--reading-width));
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.short-article {
  font-size: clamp(1.12rem, 2vw, 1.3rem);
}

.short-article > p:first-child {
  color: var(--forest);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  line-height: 1.45;
}

.short-actions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.button-dark {
  background: var(--forest);
}

.button-dark:hover {
  background: var(--forest-soft);
}

.button-outline {
  color: var(--forest);
  border-color: var(--forest);
}

.button-outline:hover {
  color: #fff;
  background: var(--forest);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 2rem max(1.5rem, calc((100% - 76rem) / 2));
  color: #b9c9c5;
  background: var(--forest);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff5ee;
}

:focus-visible {
  outline: 3px solid #e66e45;
  outline-offset: 3px;
}

@media (max-width: 860px) {
  body {
    font-size: 1rem;
  }

  .hero-inner,
  .short-hero-inner,
  .short-main,
  .page-shell {
    width: min(100% - 2rem, var(--reading-width));
  }

  .page-shell {
    display: block;
    padding-top: 2.5rem;
  }

  .toc-inner {
    position: static;
    max-height: 18rem;
    margin-bottom: 4rem;
    padding: 1.2rem;
    overflow: auto;
    background: rgb(255 255 255 / 45%);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--accent);
  }

  .toc ol {
    columns: 2 13rem;
    column-gap: 2rem;
  }

  .toc li {
    break-inside: avoid;
  }

  article h3 {
    margin-top: 4rem;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .publication-meta {
    display: grid;
  }

  .hero-actions,
  .short-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button,
  .short-actions .button {
    width: 100%;
  }

  .toc ol {
    columns: auto;
  }

  article blockquote {
    margin-inline: -0.25rem;
  }
}

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

@media print {
  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .skip-link,
  .toc,
  .heading-link,
  .hero-actions,
  .short-actions,
  .site-footer {
    display: none;
  }

  .hero,
  .short-hero {
    color: #000;
    background: transparent;
    border-bottom: 2pt solid #000;
  }

  .hero::after {
    display: none;
  }

  .hero-inner,
  .short-hero-inner,
  .short-main {
    width: auto;
    padding: 0 0 1.5rem;
  }

  .eyebrow,
  .hero-thesis,
  .hero-support,
  .short-deck,
  .occasion,
  .publication-meta {
    color: #000;
  }

  .page-shell {
    display: block;
    width: auto;
    padding: 2rem 0;
  }

  article h2,
  article h3,
  article h4 {
    color: #000;
    break-after: avoid;
  }

  article blockquote {
    color: #000;
    background: transparent;
    border-left-color: #000;
    break-inside: avoid;
  }
}
