@font-face {
  font-display: swap;
  font-family: "Emilio Test Light";
  font-style: normal;
  font-weight: 300;
  src: url("https://db.onlinewebfonts.com/t/1d4bbad5848fe07309fe057d76b07fed.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Aveline Eleganza";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/aveline-eleganza.woff") format("woff");
}

@font-face {
  font-display: swap;
  font-family: "Goudy Initialen";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/goudy-initialen.ttf") format("truetype");
}

:root {
  color-scheme: light;
  --background: var(--image-background, #f4eddb);
  --text: var(--image-ink, #3d3833);
  --muted: var(--image-muted, #746b62);
  --accent: var(--image-accent, #6b5d4f);
  --accent-2: var(--image-accent-2, #857a68);
  --link: var(--text);
  --selection: color-mix(in srgb, var(--accent) 24%, transparent);
  --border: color-mix(in srgb, var(--text) 24%, transparent);
  --footnote-background: color-mix(in srgb, var(--accent) 12%, transparent);
  --footnote-background-hover: color-mix(in srgb, var(--accent) 22%, transparent);
  --tooltip-background: color-mix(in srgb, var(--background) 90%, #ffffff);
  --tooltip-shadow: rgba(61, 56, 51, 0.18);
  --page-width: 760px;
  --content-width: 580px;
  --nav-font: "Aveline Eleganza", "Lora", "Times New Roman", Times, serif;
}

:root.dark {
  color-scheme: dark;
  --background: #25221f;
  --text: var(--image-ink-dark, #eae5dd);
  --muted: var(--image-muted-dark, #c2baaf);
  --accent: var(--image-accent-dark, #c2baaf);
  --accent-2: var(--image-accent-2-dark, #a99e8c);
  --tooltip-shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: var(--background);
  transition: background-color 520ms ease;
}

body {
  min-height: 100%;
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  font-family: "Emilio Test Light", "Emilio", Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.28;
  transition: background-color 520ms ease, color 520ms ease;
}

::selection {
  background: var(--selection);
  color: inherit;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.065em;
  text-underline-offset: 0.12em;
  transition: text-decoration-color 520ms ease;
}

a:hover {
  text-decoration-thickness: 0.055em;
}

.site-header,
.page {
  width: min(var(--page-width), calc(100% - 28px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--content-width);
  padding-top: 28px;
  padding-bottom: 44px;
}

.essay-template .site-header {
  max-width: var(--content-width);
}

.site-title {
  color: var(--accent);
  font-family: var(--nav-font);
  font-size: 28px;
  font-synthesis: none;
  font-weight: 400;
  line-height: 0.95;
  text-decoration: none;
  transition: color 520ms ease;
}

.site-title:hover {
  color: var(--accent);
}

.theme-toggle {
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms linear;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle__icon {
  display: none;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root:not(.dark) .theme-toggle__icon--moon {
  display: block;
}

:root.dark .theme-toggle__icon--sun {
  display: block;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 50%;
}

.waterman-page {
  display: grid;
  grid-template-columns: 250px minmax(0, 680px);
  align-items: start;
  column-gap: 96px;
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
  padding: 56px 0 84px;
}

.waterman-rail {
  position: sticky;
  top: 56px;
  padding-top: 76px;
}

.waterman-title {
  display: block;
  color: var(--accent);
  font-family: var(--nav-font);
  font-size: 56px;
  font-synthesis: none;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.8;
  text-decoration: none;
  transform: scaleY(1.12);
  transform-origin: left top;
  transition: color 520ms ease;
}

.waterman-title span {
  display: block;
}

.waterman-title:hover {
  color: var(--accent);
}

.waterman-nav {
  display: grid;
  gap: 14px;
  margin-top: 72px;
  font-family: var(--nav-font);
  font-size: 32px;
  font-weight: 400;
  line-height: 0.96;
}

.waterman-nav a {
  color: var(--text);
  text-decoration: none;
  transform: scaleY(1.12);
  transform-origin: left center;
}

.waterman-nav a:hover,
.waterman-nav a:focus-visible {
  text-decoration-line: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.12em;
}

.waterman-rail .theme-toggle {
  margin-top: 38px;
}

.waterman-main {
  min-width: 0;
}

.waterman-art {
  width: min(100%, 610px);
  margin: 0 auto 34px;
}

.waterman-art-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--image-frame-border, var(--border));
  background: color-mix(in srgb, var(--background) 88%, #ffffff);
  color: inherit;
  cursor: pointer;
  transition: height 380ms ease, background-color 520ms ease, border-color 520ms ease;
}

.waterman-art-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 8px;
}

.waterman-art img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
  transition: opacity 190ms ease;
}

.waterman-art img.is-fading {
  opacity: 0;
}

.art-frame {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease;
}

.art-frame.is-visible {
  opacity: 1;
}

.art-frame img {
  display: block;
  width: 100%;
  height: 100%;
  box-shadow: none;
}

.waterman-art-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.02em;
  text-align: center;
  transition: color 520ms ease;
}

.waterman-art-caption [data-random-art-caption] {
  min-width: 0;
}

.plate-nav {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-style: normal;
  line-height: 1;
  transition: color 520ms ease, transform 140ms ease;
}

.plate-nav:hover {
  color: var(--accent);
}

.plate-nav:active {
  transform: translateY(1px);
}

.plate-nav:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.waterman-art-caption .plate-no {
  margin-right: 0.55em;
  color: var(--accent-2);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 520ms ease;
}

/* Palette stepper in the colophon. Temporary home while the plates are muted
   in index.html; when the plates come back, drop this block and the
   .theme-cycle markup along with it. */
.theme-cycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.theme-cycle__label {
  min-width: 0;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.02em;
  transition: color 520ms ease;
}

.theme-cycle .plate-no {
  margin-right: 0.55em;
  color: var(--accent-2);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 520ms ease;
}

.waterman-content {
  display: grid;
  gap: 32px;
  max-width: 620px;
  margin-inline: auto;
  font-size: 18px;
  line-height: 1.42;
}

.waterman-section {
  scroll-margin-top: 32px;
}

.waterman-section + .waterman-section {
  margin-top: 0;
}

.waterman-section h2 {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.24em;
  line-height: 1;
  text-transform: uppercase;
  transition: color 520ms ease;
}

.waterman-colophon {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  text-align: center;
}

.colophon-fleuron {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 19px;
  font-style: normal;
  transition: color 520ms ease;
}

.page-footnote {
  grid-column: 2;
  margin-top: 72px;
  padding-top: 16px;
  position: relative;
}

.page-footnote::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 104px;
  border-top: 1px solid var(--border);
}

.page-footnote p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.page-footnote a {
  color: var(--muted);
}

.page-footnote a:hover {
  color: var(--text);
}

.page-footnote__ref {
  position: relative;
  top: -0.3em;
  margin-right: 0.4em;
  color: var(--accent);
  font-size: 0.8em;
  transition: color 520ms ease;
}

.waterman-home .waterman-page {
  padding-bottom: 28px;
}

@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .botanical-footer {
    height: 170px;
    margin-top: 0;
    background-color: var(--accent-2);
    opacity: 0.55;
    transition: background-color 520ms ease;
    -webkit-mask-image: url("assets/botanical-footer.png");
    -webkit-mask-position: bottom center;
    -webkit-mask-repeat: repeat-x;
    -webkit-mask-size: auto 100%;
    mask-image: url("assets/botanical-footer.png");
    mask-position: bottom center;
    mask-repeat: repeat-x;
    mask-size: auto 100%;
  }
}

.waterman-intro {
  display: grid;
  gap: 14px;
}

@media (max-width: 900px) {
  .waterman-page {
    display: block;
    width: min(100% - 28px, 680px);
    padding-top: 28px;
  }

  .waterman-rail {
    position: static;
    padding-top: 0;
    margin-bottom: 34px;
  }

  .waterman-title {
    font-size: 44px;
    line-height: 0.82;
  }

  .waterman-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 28px;
    font-size: 24px;
  }

  .waterman-rail .theme-toggle {
    margin-top: 24px;
  }

  .waterman-art {
    width: min(100%, 540px);
  }

  .waterman-art-button {
    padding: 20px;
  }

}

@media (max-width: 720px) and (orientation: portrait) {
  .waterman-rail {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 12px;
  }

  .waterman-title {
    flex: 0 0 100%;
  }

  .waterman-nav {
    flex: 0 1 auto;
  }

  .waterman-rail .theme-toggle {
    flex: 0 0 auto;
    margin-top: 26px;
  }
}

.contents-toggle {
  position: fixed;
  z-index: 20;
  top: 42px;
  left: 28px;
  display: none;
  width: 32px;
  height: 28px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.contents-toggle__bar {
  position: absolute;
  left: 6px;
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: opacity 120ms ease, transform 160ms ease;
}

.contents-toggle__bar:nth-child(1) {
  top: 7px;
}

.contents-toggle__bar:nth-child(2) {
  top: 13px;
}

.contents-toggle__bar:nth-child(3) {
  top: 19px;
}

.contents-toggle[aria-expanded="true"] .contents-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.contents-toggle[aria-expanded="true"] .contents-toggle__bar:nth-child(2) {
  opacity: 0;
}

.contents-toggle[aria-expanded="true"] .contents-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.contents-panel {
  position: fixed;
  z-index: 15;
  top: 0;
  left: 0;
  display: none;
  width: min(244px, 76vw);
  height: 100vh;
  padding: 76px 24px 24px;
  background-color: var(--background);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px var(--tooltip-shadow);
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 160ms ease;
  visibility: hidden;
}

.contents-panel.is-open {
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
}

.essay-template .contents-toggle,
.essay-template .contents-panel {
  display: block;
}

/* Invisible strip along the left edge: moving the cursor into it reveals the
   contents. Sits under the panel so the panel keeps its own hover. */
.contents-hover-zone {
  display: none;
}

.essay-template .contents-hover-zone {
  position: fixed;
  z-index: 14;
  top: 0;
  left: 0;
  /* Everything to the left of the centred column is the trigger. site.js only
     measures this box, so it must not swallow clicks or text selection. */
  width: max(0px, calc(50vw - var(--content-width) / 2));
  height: 100vh;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .essay-template .contents-hover-zone {
    display: block;
  }
}

.contents-heading {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1;
}

.contents-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
  list-style: none;
  font-size: 14px;
  line-height: 1.22;
}

.contents-marker {
  position: absolute;
  top: 0;
  left: -1.5px;
  width: 2px;
  height: 22px;
  background: var(--accent);
  transition: background-color 520ms ease;
}

.contents-list a {
  position: relative;
  display: block;
  padding: 7px 0 7px 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.contents-list a:hover,
.contents-list a:focus-visible {
  color: var(--text);
  text-decoration-line: underline;
}

.contents-list a.is-active {
  color: var(--text);
  font-weight: 300;
}

.contents-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.page {
  max-width: var(--content-width);
  padding-bottom: 56px;
}

.article-page {
  max-width: var(--content-width);
}

section + section {
  margin-top: 32px;
}

.intro {
  display: grid;
  gap: 14px;
}

p,
h1,
h2,
ul {
  margin: 0;
}

h2 {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 14px;
}

.link-list {
  display: grid;
  gap: 11px;
  padding-left: 0;
  list-style: none;
}

.essay-header {
  margin-bottom: 36px;
}

.essay-title {
  max-width: 16ch;
  margin: 0 0 8px;
  font-size: 60px;
  font-weight: 300;
  line-height: 0.96;
  text-wrap: balance;
}

.essay-subtitle {
  max-width: 26ch;
  font-size: 22px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.12;
  text-wrap: balance;
}

.essay-date {
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
}

.essay-body {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.42;
  text-wrap: pretty;
}

/* The fleuron now closes the page below the footnotes (.essay-colophon).
   The rule separating body from footnotes comes from .footnotes' own
   border-top, so the body needs no trailing ornament of its own. */

.dropcap {
  float: left;
  margin: 0.03em 0.12em 0 0;
  color: var(--accent);
  font-family: "Goudy Initialen", "Emilio Test Light", "Emilio", Georgia, "Times New Roman", serif;
  font-size: 6.2em;
  font-style: normal;
  font-weight: 400;
  line-height: 0.8;
  padding-top: 0.04em;
  transition: color 520ms ease;
}

.essay-body p + p,
.essay-body h2,
.essay-body blockquote,
.essay-body ol,
.essay-body ul {
  clear: left;
}

.essay-body p + p {
  margin-top: 1em;
}

.essay-body h2 {
  margin-top: 42px;
  margin-bottom: 8px;
  font-size: 32px;
  scroll-margin-top: 28px;
  text-wrap: balance;
}

.section-subtitle {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 24px;
  font-style: italic;
  line-height: 1.25;
}

.essay-body blockquote {
  margin: 1.4em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 1px solid color-mix(in srgb, var(--accent) 62%, transparent);
  font-style: italic;
}

.essay-body sup {
  position: relative;
  top: -0.35em;
  font-size: 0.6em;
  line-height: 0;
}

.footnote-ref {
  display: inline-block;
  border-radius: 4px;
  padding: 0.1em 0.3em 0.03em;
  background: var(--footnote-background);
  text-decoration: none;
}

.footnote-ref:hover,
.footnote-ref:focus-visible {
  background: var(--footnote-background-hover);
}

.footnote-ref.is-return-target {
  animation: footnote-return-pulse 900ms ease;
  background: var(--footnote-background-hover);
}

.footnote-tooltip {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.65em);
  left: 50%;
  width: min(280px, 80vw);
  padding: 12px 14px;
  background: var(--tooltip-background);
  box-shadow: 0 6px 18px var(--tooltip-shadow);
  color: var(--text);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.45;
  text-align: left;
  transform: translateX(-50%);
  visibility: hidden;
}

.essay-body sup:hover .footnote-tooltip,
.essay-body sup:focus-within .footnote-tooltip {
  visibility: visible;
}

.footnote-tooltip__label {
  font-weight: 300;
}

.footnotes {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.82em;
  font-weight: 300;
  line-height: 1.45;
}

.footnotes h2 {
  margin-bottom: 14px;
  font-size: 32px;
}

.footnotes-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footnote-backref {
  margin-right: 0.4em;
  font-weight: 300;
  text-decoration: none;
}

@keyframes footnote-return-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 transparent;
  }

  35% {
    box-shadow: 0 0 0 4px var(--footnote-background-hover);
  }
}

/* Closing colophon: same rule + fleuron as the homepage, sitting below the
   footnotes. On pages with no footnotes this is the only divider, so the page
   still ends the same way. */
.essay-colophon {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.essay-colophon .colophon-fleuron {
  margin-bottom: 0;
  font-size: 22px;
}

/* The fleuron IS the back-to-top control; the label only appears on hover so
   the ornament stays an ornament until you reach for it. */
.colophon-top {
  position: relative;
  display: inline-block;
  padding: 2px 10px 0;
  color: inherit;
  line-height: 1;
  text-decoration: none;
}

.colophon-top .colophon-fleuron {
  transition: color 200ms ease;
}

.colophon-top:hover .colophon-fleuron,
.colophon-top:focus-visible .colophon-fleuron {
  color: var(--accent);
}

.colophon-top:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
}

.colophon-tip {
  position: absolute;
  top: calc(100% + 0.7em);
  left: 50%;
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 160ms ease;
  visibility: hidden;
}

.colophon-top:hover .colophon-tip,
.colophon-top:focus-visible .colophon-tip {
  opacity: 1;
  visibility: visible;
}

/* No hover to reveal the label, so leave room and show it. */
@media (hover: none) {
  .colophon-tip {
    opacity: 1;
    visibility: visible;
  }

  .essay-colophon {
    padding-bottom: 26px;
  }
}

/* --- Touch footnotes -----------------------------------------------------
   With a pointer, hovering [n] previews the note and clicking it jumps to the
   list at the foot of the page. Without hover there is no preview, so a tap
   opens the note in place. This wins over the `display: none` that otherwise
   hides the tooltip on small screens. */
.essay-body sup.is-open .footnote-tooltip {
  display: block;
  visibility: visible;
}

@media (hover: none), (max-width: 720px) {
  .footnote-tooltip {
    width: min(320px, calc(100vw - 32px));
    padding: 13px 15px;
    font-size: 14px;
  }
}

/* A tap outside dismisses; this backdrop is what catches it. */
.footnote-backdrop {
  position: fixed;
  z-index: 4;
  inset: 0;
  background: transparent;
}

.link-note {
  margin-left: 0.5em;
  color: var(--accent-2);
  font-size: 11.5px;
  font-style: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  vertical-align: 0.12em;
}

/* --- Draft-report scaffolding -------------------------------------------
   Used by subliminal-learning-report.html. `.fill` marks prompts that are
   meant to be deleted as each section gets written; once a page has no
   `.fill` left, it is finished. Safe to delete this whole block when the
   last draft page goes live. */
.draft-banner {
  margin: 0 0 34px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--footnote-background);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.draft-banner strong {
  color: var(--text);
}

.essay-body p.fill {
  padding-left: 14px;
  border-left: 2px dashed var(--border);
  color: var(--muted);
  font-style: italic;
}

/* --- Data tables --------------------------------------------------------- */
.data-table {
  width: 100%;
  margin: 22px 0 26px;
  border-collapse: collapse;
  font-size: 15.5px;
  font-style: normal;
  text-align: left;
}

.data-table caption {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: baseline;
}

.data-table thead th {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td:not(:first-child),
.data-table thead th:not(:first-child) {
  font-variant-numeric: tabular-nums;
}

.note-inline {
  color: var(--muted);
  font-size: 13.5px;
  font-style: italic;
}

/* Wide tables scroll inside their own box rather than the page. */
@media (max-width: 620px) {
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  body {
    font-size: 18px;
  }

  .site-header,
  .page {
    width: min(100% - 24px, var(--page-width));
  }

  .site-header {
    align-items: flex-start;
    max-width: var(--content-width);
    padding-top: 22px;
    padding-bottom: 36px;
  }

  .essay-template .site-header {
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    max-width: var(--content-width);
  }

  .essay-template .site-title {
    margin-right: auto;
  }

  .contents-toggle {
    position: relative;
    z-index: 25;
    top: auto;
    left: auto;
    flex: 0 0 auto;
    margin: 0;
  }

  .contents-toggle__bar {
    height: 2px;
  }

  .contents-panel {
    top: 86px;
    left: 0;
    width: 100%;
    height: calc(100vh - 86px);
    padding: 42px 30px 32px;
    overflow: auto;
    border-right: 0;
    background-color: var(--background);
    box-shadow: none;
    opacity: 0;
    transform: none;
    transition: opacity 140ms ease;
  }

  .contents-panel.is-open {
    opacity: 1;
    transform: none;
  }

  .contents-panel.is-closing {
    opacity: 0;
    transform: none;
    visibility: visible;
  }

  .contents-heading {
    margin-bottom: 28px;
    color: var(--text);
    font-size: 32px;
  }

  .contents-list {
    display: block;
    padding-left: 1.1em;
    border-left: 0;
    list-style: decimal;
    font-size: 24px;
    line-height: 1.65;
  }

  .contents-list li + li {
    margin-top: 4px;
  }

  .contents-marker {
    display: none;
  }

  .contents-list a {
    display: inline;
    padding: 0;
    color: var(--text);
  }

  .contents-list a.is-active {
    font-weight: inherit;
  }

  .essay-template.contents-open {
    overflow: hidden;
  }

  .essay-template.contents-open .page {
    visibility: hidden;
  }

  .site-title {
    font-size: 22px;
  }

  h2 {
    font-size: 32px;
    margin-bottom: 12px;
  }

  .essay-title {
    font-size: 60px;
  }

  .essay-subtitle {
    font-size: 22px;
  }

  .essay-date {
    margin-top: 18px;
    font-size: 18px;
  }

  .footnote-tooltip {
    display: none;
  }

  .intro,
  .link-list {
    gap: 10px;
  }
}

/* Only retire the hamburger where the edge-hover actually works. On a
   desktop-width touch screen there is no hover, so the button must stay or
   the contents become unreachable. */
@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .essay-template .contents-toggle {
    display: none;
  }
}

@media (min-width: 1100px) {
  .contents-panel {
    top: 150px;
    left: 40px;
    width: min(230px, calc(50vw - 340px));
    height: auto;
    max-height: calc(100vh - 190px);
    padding: 0;
    overflow: auto;
    border-right: 0;
    background: transparent;
    box-shadow: none;
    /* Hidden until the cursor reaches the left edge (see .contents-hover-zone).
       visibility has to be held until the opacity animation finishes, or it
       switches to hidden immediately and the panel blinks out instead of
       fading. */
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: opacity 260ms ease, visibility 0s linear 260ms;
    visibility: hidden;
  }

  .contents-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 260ms ease, visibility 0s linear 0s;
    visibility: visible;
  }

  .contents-heading {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .contents-list {
    line-height: 1.3;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 18px;
  }

  .site-title {
    font-size: 22px;
  }

  .site-header {
    gap: 16px;
  }

  h2 {
    font-size: 32px;
  }
}
