/* minetique.com. Ink, paper, lichen and copper from the first homepage (August 2026).
   Lichen marks action and living knowledge; copper marks provenance, time and structure. */

:root {
  color-scheme: dark;
  --ink: #0b0f0d;
  --ink-raised: #111713;
  --ink-line: rgba(238, 232, 219, 0.12);
  --paper: #eee8db;
  --paper-body: #d8d3c8;
  --ash: #aaa99f;
  --ash-dim: #85877f;
  --lichen: #78a981;
  --moss: #365d42;
  --moss-bright: #477552;
  --copper: #9d6145;
  --copper-text: #c48a6c;
  --copper-line: rgba(157, 97, 69, 0.3);
  --line: rgba(238, 232, 219, 0.2);
  --serif: Baskerville, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --wide: 76rem;
  --measure: 42rem;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 70% 12rem, rgba(62, 91, 69, 0.08), transparent 32rem),
    var(--ink);
  color: var(--paper-body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.016), transparent 35%, rgba(255, 255, 255, 0.008));
  content: "";
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

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

::selection {
  background: rgba(120, 169, 129, 0.35);
  color: var(--paper);
}

h1,
h2,
h3 {
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

code {
  padding: 0.1em 0.35em;
  background: rgba(238, 232, 219, 0.07);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.86em;
}

pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--ink-line);
  background: var(--ink-raised);
  color: var(--paper);
  font: 0.88rem/1.75 var(--mono);
}

pre[data-copy] {
  padding-right: 5.5rem;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: var(--gutter);
  z-index: 20;
  padding: 0.55rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  display: flex;
  position: relative;
  z-index: 5;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.65rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--paper);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.9rem);
}

.site-nav a {
  padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
  color: var(--ash);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}

.site-nav a:hover {
  color: var(--paper);
}

.site-nav a[aria-current] {
  border-color: var(--copper);
  color: var(--paper);
}

.menu-link {
  display: none;
}

/* Buttons and links */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0 1.6rem;
  border: 1px solid var(--lichen);
  background: var(--moss);
  color: #f5f0e4;
  font: 500 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease;
}

.button:hover {
  background: var(--moss-bright);
}

.site-nav .button {
  min-height: 2.5rem;
  padding: 0 1.05rem;
  border: 1px solid var(--lichen);
  color: #f5f0e4;
  font-size: 0.9rem;
}

.site-nav .button[aria-current] {
  border-color: var(--lichen);
  background: var(--moss-bright);
}

.link,
.prose a,
.section a:not(.button):not(.index-link),
.thesis a,
.next a:not(.button) {
  color: var(--paper);
  text-decoration-line: underline;
  text-decoration-color: rgba(120, 169, 129, 0.65);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.link:hover,
.prose a:hover,
.section a:not(.button):not(.index-link):hover,
.thesis a:hover,
.next a:not(.button):hover {
  color: var(--lichen);
  text-decoration-color: var(--lichen);
}

.copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--ash);
  font: 0.78rem/1.4 var(--sans);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.copy:hover {
  border-color: var(--lichen);
  color: var(--paper);
}

/* Home: hero and context map, carried over from the first homepage */

.hero {
  display: grid;
  grid-template-columns: minmax(30rem, 0.96fr) minmax(36rem, 1.04fr);
  gap: 2rem;
  min-height: 650px;
  padding-top: clamp(3.5rem, 6vw, 6rem);
  padding-bottom: 3.5rem;
}

.hero-copy {
  z-index: 2;
  align-self: center;
  max-width: 43rem;
  padding-bottom: 2rem;
  animation: reveal 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4rem, 5.45vw, 5.9rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.accent-rule {
  display: block;
  width: 3.6rem;
  height: 2px;
  margin: clamp(2.2rem, 4.5vw, 4rem) 0 2rem;
  background: var(--lichen);
}

.hero-copy p {
  max-width: 37rem;
  margin: 0;
  color: var(--paper-body);
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  font-weight: 300;
  line-height: 1.6;
}

.hero-copy .hero-sub {
  margin-top: 1.25rem;
  color: var(--ash);
  font-size: clamp(1.02rem, 1.2vw, 1.12rem);
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.4rem;
}

.hero-copy .hero-note {
  max-width: 21rem;
  color: var(--ash-dim);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.5;
}

.context-map {
  --pointer-x: 0;
  --pointer-y: 0;
  position: relative;
  min-height: 580px;
  perspective: 1100px;
  animation: reveal 1200ms 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.lineage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: rgba(120, 169, 129, 0.75);
  stroke-width: 1.1;
}

.lineage path {
  stroke-dasharray: 6 6;
  animation: drift 12s linear infinite;
}

.lineage circle {
  fill: var(--moss);
  stroke: var(--lichen);
}

.fragment,
.shared-context,
.label {
  border: 1px solid rgba(211, 218, 205, 0.46);
  background: rgba(24, 30, 26, 0.8);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.035);
}

.fragment,
.shared-context {
  position: absolute;
  backdrop-filter: blur(14px);
  transition: border-color 220ms ease, background 220ms ease, transform 320ms cubic-bezier(0.2, 0.75, 0.2, 1);
  transform:
    translate3d(calc(var(--pointer-x) * var(--depth, 1) * 9px), calc(var(--pointer-y) * var(--depth, 1) * 9px), 0)
    rotateX(calc(var(--pointer-y) * -1.25deg))
    rotateY(calc(var(--pointer-x) * 1.25deg));
}

.fragment:hover,
.fragment:focus-visible,
.shared-context:hover,
.shared-context:focus-visible {
  z-index: 4;
  border-color: rgba(120, 169, 129, 0.9);
  outline: none;
  background: rgba(31, 40, 34, 0.96);
}

.fragment {
  width: 14.75rem;
  min-height: 12.5rem;
  padding: 1.125rem;
}

.fragment h2,
.shared-context h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.fragment p,
.shared-context p,
.shared-context footer {
  color: #c6c6bd;
  font-size: 0.84rem;
  line-height: 1.5;
}

.fragment p {
  min-height: 3.2rem;
  margin: 0;
}

.fragment small {
  display: block;
  margin-top: 0.8rem;
  color: var(--ash-dim);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.fragment-know {
  --depth: 0.8;
  top: 0;
  left: 20%;
}

.fragment-decide {
  --depth: 1.15;
  top: 35%;
  left: 7%;
}

.fragment-changed {
  --depth: 0.95;
  bottom: -2rem;
  left: 0;
}

.fragment-open {
  --depth: 1.3;
  right: 25%;
  bottom: -1rem;
}

.shared-context {
  --depth: 0.45;
  top: 24%;
  right: 0;
  width: 13.5rem;
  min-height: 19.5rem;
  padding: 1.7rem;
  border-bottom: 2px solid var(--copper);
}

.shared-context svg {
  width: 2rem;
  margin-bottom: 1rem;
  fill: none;
  stroke: var(--lichen);
  stroke-width: 1.2;
}

.shared-context p + p {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.shared-context footer {
  margin-top: 1.7rem;
  color: #8c918b;
}

.shared-rule {
  display: block;
  width: 2.1rem;
  height: 1px;
  margin-bottom: 1.15rem;
  background: var(--moss);
}

.specimen {
  display: block;
  width: 2rem;
  height: 1.75rem;
  margin-bottom: 0.7rem;
  opacity: 0.9;
}

.specimen-crystal,
.specimen-open {
  border: 1px solid var(--lichen);
  clip-path: polygon(50% 0, 82% 30%, 72% 82%, 50% 100%, 24% 80%, 16% 31%);
  transform: rotate(4deg);
}

.specimen-open {
  border-color: var(--copper);
  transform: rotate(18deg) scale(0.84);
}

.specimen-branch {
  position: relative;
  width: 1px;
  margin-left: 0.8rem;
  background: var(--copper);
  transform: rotate(-9deg);
}

.specimen-branch::before,
.specimen-branch::after {
  position: absolute;
  width: 1rem;
  height: 1px;
  background: var(--copper);
  content: "";
  transform-origin: left;
}

.specimen-branch::before {
  top: 0.8rem;
  transform: rotate(-38deg);
}

.specimen-branch::after {
  top: 1.45rem;
  transform: rotate(35deg);
}

.specimen-leaf {
  border: 1px solid var(--lichen);
  border-radius: 100% 0 100% 0;
  transform: rotate(-24deg) scale(0.82);
}

/* Home sections */

.section {
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--copper-line);
}

.section h2 {
  max-width: 24ch;
  margin: 0 0 1.4rem;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.section p {
  max-width: 40rem;
  margin: 0 0 1.1rem;
}

.section .lede {
  color: var(--paper-body);
  font-size: clamp(1.12rem, 1.4vw, 1.3rem);
  font-weight: 300;
  line-height: 1.6;
}

.section-head {
  margin-bottom: clamp(2.2rem, 4vw, 3.5rem);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.split-even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tree {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.85;
}

.tree span {
  color: var(--ash-dim);
}

.layers {
  margin: 0;
}

.layers > div {
  display: grid;
  grid-template-columns: minmax(9rem, 2fr) minmax(0, 3fr);
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--ink-line);
}

.layers > div:last-child {
  border-bottom: 1px solid var(--ink-line);
}

.layers dt {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.25;
}

.layers dt code {
  display: block;
  width: fit-content;
  margin-top: 0.4rem;
  color: var(--copper-text);
  font-size: 0.72rem;
}

.layers dd {
  margin: 0;
  font-size: 0.98rem;
}

/* The catalogue label: how a vault keeps one claim */

.label {
  max-width: 34rem;
  margin: 0 0 2.25rem;
  border-bottom: 2px solid var(--copper);
}

.label dl {
  margin: 0;
}

.label dl > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 1.3rem;
  border-top: 1px solid var(--ink-line);
}

.label dl > div:first-child {
  padding-top: 1.25rem;
  border-top: 0;
}

.label dt {
  padding-top: 0.12rem;
  color: var(--ash);
  font-size: 0.82rem;
}

.label dd {
  margin: 0;
  color: var(--paper);
  font-size: 0.97rem;
  line-height: 1.5;
}

.label dl > div:first-child dd {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.35;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--paper);
  white-space: nowrap;
}

.state::before {
  width: 0.62rem;
  height: 0.62rem;
  border: 1.5px solid var(--lichen);
  border-radius: 50%;
  content: "";
}

.state-verified::before {
  background: var(--lichen);
}

.state-reported::before {
  border-color: var(--copper-text);
}

.state-inferred::before {
  border-style: dashed;
  border-color: var(--ash);
}

.states {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.states li {
  color: var(--paper-body);
  font-size: 0.95rem;
}

.states .state {
  display: flex;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

/* Sequences: only for content that really is a sequence */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0 0 2.5rem;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.steps > li {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps > li::before {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--copper-text);
  font-family: var(--serif);
  font-size: 2.3rem;
  line-height: 1;
  content: counter(step);
}

.steps h3 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.steps p {
  margin: 0;
  font-size: 0.97rem;
}

/* Ruled index of pages */

.index {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--ink-line);
  list-style: none;
}

.index li {
  border-top: 1px solid var(--ink-line);
}

.index-link {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 0.4rem 2rem;
  padding: 1.45rem 0;
  color: inherit;
  text-decoration: none;
}

.index-title {
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.2;
  transition: color 160ms ease;
}

.index-link:hover .index-title {
  color: var(--lichen);
}

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

.index-compact .index-link {
  grid-template-columns: minmax(0, 1fr);
  padding: 1.2rem 0;
}

.index-compact .index-title {
  font-size: 1.35rem;
}

/* Thesis and continuum, carried over from the first homepage */

.thesis {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: clamp(4rem, 7vw, 6rem) clamp(3rem, 5vw, 4.5rem);
  border-top: 1px solid var(--copper-line);
  text-align: center;
}

.thesis h2 {
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.thesis p {
  max-width: 40rem;
  margin: 2rem 0 0;
  font-size: 1.1rem;
}

.continuum {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-block: clamp(2.3rem, 4vw, 3.5rem) 2rem;
  padding-top: 1.55rem;
  border-top: 1px solid rgba(157, 97, 69, 0.38);
  color: #bebdb5;
  font-size: clamp(0.66rem, 0.95vw, 0.82rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.continuum i {
  position: relative;
  width: clamp(2.2rem, 6vw, 6rem);
  height: 1px;
  margin-inline: clamp(0.8rem, 2vw, 1.8rem);
  background: linear-gradient(90deg, transparent, var(--lichen));
}

.continuum i::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--lichen);
  border-right: 1px solid var(--lichen);
  content: "";
  transform: rotate(45deg);
}

/* Inner pages */

.page-head {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.crumb {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.crumb a {
  color: var(--ash);
  text-decoration: none;
  border-bottom: 1px solid var(--copper);
}

.crumb a:hover {
  color: var(--paper);
}

.page-head h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.75rem, 6vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.page-head .lede {
  max-width: 41rem;
  margin: 2rem 0 0;
  color: var(--paper-body);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 300;
  line-height: 1.6;
}

.page-head::after {
  display: block;
  width: 3.6rem;
  height: 2px;
  margin-top: 2.6rem;
  background: var(--lichen);
  content: "";
}

.article {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) 14.5rem;
  justify-content: start;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
  padding-bottom: clamp(3.5rem, 6vw, 5.5rem);
}

.article > .toc {
  grid-row: 1;
  grid-column: 2;
}

.article > .prose {
  grid-row: 1;
  grid-column: 1;
}

.toc {
  position: sticky;
  top: 2rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--copper-line);
  font-size: 0.86rem;
  line-height: 1.45;
}

.toc p {
  margin: 0 0 0.8rem;
  color: var(--ash-dim);
}

.toc ul {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  color: var(--ash);
  text-decoration: none;
}

.toc a:hover {
  color: var(--paper);
}

.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin: 3.4rem 0 1.1rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--copper-line);
  font-size: clamp(1.75rem, 2.8vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  scroll-margin-top: 1.5rem;
}

.prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  margin: 2.3rem 0 0.7rem;
  font-size: 1.35rem;
  line-height: 1.25;
  scroll-margin-top: 1.5rem;
}

.prose p,
.prose ul,
.prose ol,
.prose dl {
  margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose li::marker {
  color: var(--copper-text);
}

.prose strong {
  color: var(--paper);
  font-weight: 600;
}

.prose .label {
  margin-block: 2rem;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--copper);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
}

.prose blockquote p {
  margin: 0;
}

.prose .defs > div {
  padding: 1rem 0;
  border-top: 1px solid var(--ink-line);
}

.prose .defs dt {
  color: var(--paper);
  font-weight: 600;
}

.prose .defs dd {
  margin: 0.25rem 0 0;
}

.prose .procedure {
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.prose .procedure > li {
  position: relative;
  padding: 1.4rem 0 0.4rem 3.4rem;
  border-top: 1px solid var(--ink-line);
  counter-increment: step;
}

.prose .procedure > li + li {
  margin-top: 0;
}

.prose .procedure > li::before {
  position: absolute;
  top: 1.15rem;
  left: 0;
  color: var(--copper-text);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
  content: counter(step);
}

.prose .procedure h3 {
  margin: 0 0 0.6rem;
}

.prose .procedure pre {
  margin-block: 1rem;
}

.small {
  color: var(--ash);
  font-size: 0.9rem;
}

.table-wrap {
  margin: 1.75rem 0 2rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  line-height: 1.5;
}

th,
td {
  padding: 0.9rem 1.1rem 0.9rem 0;
  border-bottom: 1px solid var(--ink-line);
  text-align: left;
  vertical-align: top;
}

thead th {
  border-bottom-color: var(--copper-line);
  color: var(--ash);
  font-size: 0.84rem;
  font-weight: 400;
}

tbody th {
  color: var(--paper);
  font-weight: 500;
}

.wide-table {
  max-width: none;
}

/* The next step at the end of a page: one ask */

.next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-block: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--copper-line);
}

.next p {
  max-width: 38rem;
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.3;
}

/* Principles: the essay is set in the serif */

.essay {
  max-width: 39rem;
  padding-bottom: clamp(3rem, 6vw, 5rem);
  color: var(--paper-body);
  font-family: var(--serif);
  font-size: clamp(1.18rem, 1.5vw, 1.32rem);
  line-height: 1.75;
}

.essay p {
  margin: 0 0 1.35rem;
}

.essay .turn {
  margin: 2.6rem 0;
  color: var(--paper);
  font-size: 1.55em;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.essay h2 {
  margin: 3.6rem 0 1.4rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--copper-line);
  font-size: clamp(1.75rem, 2.8vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.essay ul {
  margin: 0 0 1.35rem;
  padding-left: 1.2rem;
}

.essay li + li {
  margin-top: 0.55rem;
}

.essay li::marker {
  color: var(--copper-text);
}

/* Skills catalogue */

.skill-list {
  margin: 0 0 1.5rem;
}

.skill-list > div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--ink-line);
}

.skill-list > div:last-child {
  border-bottom: 1px solid var(--ink-line);
}

.skill-list dt code {
  padding: 0;
  background: none;
  font-size: 0.9rem;
}

.skill-list dt a {
  text-decoration-color: rgba(120, 169, 129, 0.45);
}

.skill-list dd {
  margin: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(238, 232, 219, 0.08);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  padding-block: 3rem 2.5rem;
}

.footer-nav h2 {
  margin: 0 0 0.9rem;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
}

.footer-nav ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--ash);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--paper);
}

.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.2rem 1.6rem;
  border-top: 1px solid rgba(238, 232, 219, 0.08);
  color: var(--ash-dim);
  font-size: 0.76rem;
}

.footer-base a {
  color: var(--paper);
  text-decoration-line: underline;
  text-decoration-color: rgba(120, 169, 129, 0.65);
  text-underline-offset: 0.24em;
}

.footer-base a:hover {
  color: var(--lichen);
}

/* Motion */

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes drift {
  to {
    stroke-dashoffset: -120;
  }
}

/* Narrower screens */

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .context-map {
    transform: scale(0.86);
    transform-origin: center right;
  }

  .article {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .article > .toc {
    position: static;
    grid-row: 1;
    grid-column: 1;
    margin-bottom: 2.75rem;
    padding: 1rem 0;
    border-block: 1px solid var(--copper-line);
    border-left: 0;
  }

  .article > .prose {
    grid-row: 2;
  }

  .toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
  }
}

@media (max-width: 900px) {
  .menu-link {
    display: inline-block;
    padding-block: 0.4rem;
    border-bottom: 1px solid var(--copper);
    color: var(--paper);
    font-size: 0.95rem;
    text-decoration: none;
  }

  .site-nav {
    display: none;
  }

  .site-header.is-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-top: 0.4rem;
    border-top: 1px solid var(--line);
  }

  .site-header.is-open .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--ink-line);
    font-size: 1.05rem;
  }

  .site-header.is-open .site-nav a[aria-current] {
    border-bottom-color: var(--copper);
  }

  .site-header.is-open .site-nav .button {
    align-self: flex-start;
    margin-block: 1.25rem 0.5rem;
    padding: 0 1.3rem;
    border: 1px solid var(--lichen);
  }

  .hero {
    display: block;
    padding-top: 4.5rem;
  }

  .hero-copy {
    max-width: 44rem;
    padding-bottom: 4rem;
  }

  .context-map {
    width: min(100%, 46rem);
    min-height: 560px;
    margin-inline: auto;
    transform: none;
  }

  .split,
  .split-even {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    padding-top: 1.2rem;
  }

  .hero {
    min-height: 0;
    padding-top: 3.5rem;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }

  .hero-copy p {
    font-size: 1.12rem;
  }

  .context-map {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    min-height: auto;
    perspective: none;
  }

  .lineage {
    display: none;
  }

  .fragment,
  .shared-context {
    position: static;
    width: auto;
    min-height: 0;
    transform: none;
  }

  .fragment {
    padding: 1.15rem;
  }

  .fragment p {
    min-height: 0;
  }

  .fragment small {
    display: none;
  }

  .shared-context {
    grid-column: 1 / -1;
    padding: 1.35rem;
  }

  .shared-context p + p,
  .shared-context footer {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
  }

  .layers > div,
  .label dl > div,
  .index-link,
  .skill-list > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .label dl > div {
    gap: 0.2rem;
  }

  .states,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .continuum {
    flex-direction: column;
    gap: 1rem;
  }

  .continuum i {
    width: 1px;
    height: 1.6rem;
    margin: 0;
    background: linear-gradient(180deg, transparent, var(--lichen));
  }

  .continuum i::after {
    top: auto;
    right: -3px;
    bottom: 0;
    transform: rotate(135deg);
  }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  table.stack tr {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--ink-line);
  }

  table.stack th,
  table.stack td {
    display: block;
    padding: 0.2rem 0;
    border: 0;
  }

  table.stack tbody th {
    margin-bottom: 0.4rem;
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 400;
  }

  table.stack td::before {
    display: block;
    color: var(--ash-dim);
    font-size: 0.8rem;
    content: attr(data-label);
  }

  .prose .procedure > li {
    padding-left: 2.6rem;
  }

  .footer-base {
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
