:root,
html.light {
  color-scheme: light;
  --bg: #f5f0e6;
  --bg-2: #ece6d9;
  --surface: #fbf8f0;
  --text: #232b2b;
  --muted: #62685f;
  --accent: #234e43;
  --accent-2: #c15d3c;
  --radius: 3px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --paper: #f5f0e6;
  --forest: #234e43;
  --vermilion: #c15d3c;
  --chartreuse: #e1e9aa;
  --rule: rgba(35, 43, 43, 0.2);
  --lab-rule: rgba(245, 240, 230, 0.24);
}

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

[hidden] {
  display: none !important;
}

html {
  min-width: 280px;
  background: var(--paper);
  scroll-padding-top: 125px;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #dce3b6;
  color: var(--text);
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

figure {
  min-width: 0;
  margin: 0;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
.title {
  color: var(--text);
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(44px, 5.7vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(30px, 3.8vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 12px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p {
  margin-bottom: 1.15em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--forest);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

a:hover {
  color: var(--vermilion);
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--forest);
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--paper);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease,
    color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button:hover,
.btn:hover {
  border-color: #173e34;
  background: #173e34;
  color: var(--paper);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled,
input:disabled,
select:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled {
  transform: none;
}

.btn.ghost,
button.ghost {
  border-color: var(--rule);
  background: transparent;
  color: var(--forest);
}

.btn.ghost:hover,
button.ghost:hover {
  border-color: var(--forest);
  background: rgba(35, 78, 67, 0.06);
}

:focus-visible {
  outline: 3px solid var(--vermilion);
  outline-offset: 4px;
}

input,
select,
textarea {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  padding: 10px 12px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--forest);
}

textarea {
  width: 100%;
  resize: vertical;
}

.muted {
  color: var(--muted);
}

.eyebrow,
.kicker,
.chapter-number,
.chapter-label,
.overline {
  display: block;
  margin-bottom: 13px;
  color: var(--vermilion);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dek,
.lede {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
}

#site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  width: 100%;
  min-height: 76px;
  padding: 13px max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--rule);
  background: rgba(245, 240, 230, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#site-header > .app {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
}

#home-link {
  flex: 0 1 auto;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.035em;
  text-decoration: none;
}

#home-link:hover {
  color: var(--forest);
}

#site-header nav,
#site-header .chapter-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#site-header nav button,
#site-header nav a,
#site-header [data-chapter] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

#site-header [data-chapter]:hover {
  background: rgba(35, 78, 67, 0.06);
  color: var(--forest);
}

#site-header [aria-current="page"],
#site-header [aria-current="true"],
#site-header [aria-selected="true"],
#site-header .is-active,
#site-header .active {
  border-color: rgba(35, 78, 67, 0.2);
  background: rgba(35, 78, 67, 0.08);
  color: var(--forest);
}

#app,
#app.app {
  flex: 1 0 auto;
  width: calc(100% - 64px);
  max-width: 1180px;
  min-width: 0;
  margin: 0 auto;
  padding: 38px 0 72px;
}

#app > section + section {
  margin-top: 48px;
}

body > footer {
  width: 100%;
  margin-top: auto;
  padding: 23px max(24px, calc((100% - 1180px) / 2)) 28px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

body > footer .row {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

body > footer a {
  color: inherit;
}

.hero {
  position: relative;
  margin: 8px 0 54px;
  text-align: center;
}

.hero h1 {
  max-width: 860px;
  margin-right: auto;
  margin-bottom: 16px;
  margin-left: auto;
}

.hero > p,
.hero > header > p,
.hero .dek {
  max-width: 630px;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
}

.hero .eyebrow,
.hero .kicker,
.hero .overline {
  color: var(--vermilion);
  font-size: 11px;
}

#begin {
  min-height: 50px;
  padding: 13px 27px;
  border-color: var(--forest);
  background: var(--forest);
  color: var(--paper);
  font-size: 15px;
}

#begin:hover {
  border-color: #173e34;
  background: #173e34;
  box-shadow: 0 4px 12px rgba(35, 78, 67, 0.12);
}

.portrait-triptych {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  align-items: stretch;
  width: min(100%, 1020px);
  height: 400px;
  min-width: 0;
  margin: 30px auto 26px;
  padding: 15px 24px 21px;
  overflow: clip;
  isolation: isolate;
  text-align: left;
}

.portrait-triptych > * {
  position: relative;
  display: block;
  min-width: 0;
  height: 100%;
  margin: 0;
  border: 5px solid var(--paper);
  background: #d9d1bf;
  box-shadow: 0 8px 18px rgba(35, 43, 43, 0.14);
  text-decoration: none;
}

.portrait-triptych > :first-child {
  z-index: 1;
  margin-right: -14px;
  transform: translateY(8px) rotate(-4deg);
}

.portrait-triptych > :nth-child(2) {
  z-index: 3;
  transform: translateY(-5px);
}

.portrait-triptych > :nth-child(3) {
  z-index: 2;
  margin-left: -14px;
  transform: translateY(8px) rotate(4deg);
}

.portrait-triptych figure,
.portrait-triptych picture,
.portrait-triptych a > figure {
  height: 100%;
  margin: 0;
}

.portrait-triptych img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

.portrait-triptych figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 40px 15px 13px;
  background: linear-gradient(transparent, rgba(15, 24, 21, 0.8));
  color: #fff9ec;
  font-size: 13px;
  line-height: 1.35;
}

.portrait-triptych figcaption strong,
.portrait-triptych figcaption b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin: 36px 0;
}

.chapter-card,
.chapter-card.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 23px 0 18px;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease;
}

.chapter-card:hover,
.chapter-card.card:hover {
  border-color: var(--forest);
  background: transparent;
  box-shadow: none;
  color: var(--text);
  transform: none;
}

.chapter-card h2,
.chapter-card h3 {
  margin: 0 0 10px;
  font-size: clamp(27px, 2.8vw, 34px);
}

.chapter-card p {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.chapter-card img {
  width: 100%;
  height: 210px;
  margin-bottom: 21px;
  object-fit: cover;
  object-position: center 22%;
}

.chapter-card .eyebrow,
.chapter-card .chapter-number,
.chapter-card .chapter-label {
  margin-bottom: 13px;
}

.chapter-card .card-link,
.chapter-card .explore,
.chapter-card .arrow {
  margin-top: auto;
  color: var(--forest);
  font-size: 13px;
  font-weight: 600;
}

.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  margin: 40px 0 24px;
  padding: 21px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.timeline > * {
  flex: 1 1 140px;
  min-width: 0;
}

.timeline ol,
.timeline ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  flex: 1 1 120px;
}

.timeline strong,
.timeline b,
.timeline time {
  display: block;
  margin-bottom: 4px;
  color: var(--forest);
  font-weight: 600;
}

.chapter-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px 56px;
  margin: 5px 0 38px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

.chapter-header > div {
  flex: 1 1 420px;
  min-width: 0;
}

.chapter-header > figure,
.chapter-header > picture {
  flex: 0 1 245px;
  width: 245px;
  min-width: 0;
}

.chapter-header > img {
  flex: 0 1 245px;
  width: 245px;
}

.chapter-header > h1,
.chapter-header > h2,
.chapter-header > p {
  flex-basis: 100%;
}

.chapter-header h1 {
  margin-bottom: 13px;
}

.chapter-header img {
  width: 100%;
  height: 285px;
  object-fit: cover;
  object-position: 50% 20%;
}

.chapter-header .era,
.chapter-header .dates,
.chapter-header .place {
  color: var(--muted);
  font-size: 14px;
}

.chapter-header .dek,
.chapter-header .lede {
  max-width: 650px;
  margin-top: 18px;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: start;
  gap: 48px;
  margin-bottom: 56px;
}

.story-grid > *,
.story-grid article,
.story-grid aside,
.story-grid section {
  min-width: 0;
}

.story-grid article > p,
.story-grid .story > p,
.story-grid .story-copy > p {
  max-width: 62ch;
  line-height: 1.8;
}

.takeaway,
.connection {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--vermilion);
  color: var(--forest);
}

.takeaway p,
p.takeaway {
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.4;
}

.lab-panel,
#lab-host {
  min-width: 0;
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid rgba(15, 44, 35, 0.12);
  border-radius: 3px;
  background: var(--forest);
  box-shadow: 0 10px 28px rgba(35, 43, 43, 0.06);
  color: var(--paper);
  color-scheme: dark;
}

.lab-panel #lab-host,
#lab-host .lab-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lab-panel h2,
.lab-panel h3,
.lab-panel h4,
#lab-host h2,
#lab-host h3,
#lab-host h4 {
  color: var(--paper);
}

.lab-panel h2,
#lab-host h2 {
  margin-bottom: 12px;
  font-size: clamp(27px, 3vw, 35px);
}

.lab-panel h3,
#lab-host h3 {
  margin-bottom: 12px;
  font-size: 27px;
}

.lab-panel p,
#lab-host p {
  font-size: 14px;
  line-height: 1.6;
}

.lab-panel .muted,
#lab-host .muted,
.lab-panel .instructions,
#lab-host .instructions,
.lab-panel .lab-instructions,
#lab-host .lab-instructions {
  color: #d2d9cc;
}

.lab-panel .eyebrow,
.lab-panel .kicker,
#lab-host .eyebrow,
#lab-host .kicker {
  color: var(--chartreuse);
}

.lab-panel a,
#lab-host a {
  color: var(--chartreuse);
}

.lab-panel svg,
#lab-host svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 210px;
  margin: 14px auto 18px;
  overflow: hidden;
  color: var(--paper);
  aspect-ratio: 320 / 250;
  touch-action: none;
}

.lab-panel svg text,
#lab-host svg text {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.lab-panel svg [role="slider"],
#lab-host svg [role="slider"] {
  cursor: grab;
  touch-action: none;
}

.lab-panel svg [role="slider"]:active,
#lab-host svg [role="slider"]:active {
  cursor: grabbing;
}

.lab-panel svg [tabindex]:focus-visible,
#lab-host svg [tabindex]:focus-visible {
  outline: 2px solid var(--chartreuse);
  outline-offset: 4px;
}

.lab-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: end;
  gap: 18px;
  margin-top: 18px;
}

.lab-controls > * {
  min-width: 0;
}

.lab-controls label,
.lab-panel .field,
#lab-host .field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-width: 0;
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.lab-controls label input,
.lab-controls label select,
.lab-panel .field > input,
#lab-host .field > input {
  flex: 1 1 100%;
  width: 100%;
}

.lab-controls output,
.lab-controls label strong,
.lab-controls label b {
  color: var(--chartreuse);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lab-panel input:not([type="range"]),
.lab-panel select,
#lab-host input:not([type="range"]),
#lab-host select {
  border-color: var(--lab-rule);
  background: rgba(0, 0, 0, 0.12);
  color: var(--paper);
}

.lab-panel input[type="range"],
#lab-host input[type="range"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--chartreuse);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.lab-panel input[type="range"]::-webkit-slider-runnable-track,
#lab-host input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(245, 240, 230, 0.35);
}

.lab-panel input[type="range"]::-webkit-slider-thumb,
#lab-host input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -10px;
  border: 3px solid var(--forest);
  border-radius: 50%;
  background: var(--chartreuse);
  box-shadow: 0 0 0 1px var(--chartreuse);
  -webkit-appearance: none;
  appearance: none;
}

.lab-panel input[type="range"]::-moz-range-track,
#lab-host input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 4px;
  background: rgba(245, 240, 230, 0.35);
}

.lab-panel input[type="range"]::-moz-range-thumb,
#lab-host input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--forest);
  border-radius: 50%;
  background: var(--chartreuse);
  box-shadow: 0 0 0 1px var(--chartreuse);
}

.lab-panel input[type="range"]:active::-webkit-slider-thumb,
#lab-host input[type="range"]:active::-webkit-slider-thumb {
  background: #f1bb87;
  box-shadow: 0 0 0 1px #f1bb87;
}

.lab-panel button,
.lab-panel .btn,
#lab-host button,
#lab-host .btn {
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--lab-rule);
  background: transparent;
  color: var(--paper);
  font-size: 13px;
}

.lab-panel button:hover,
.lab-panel .btn:hover,
#lab-host button:hover,
#lab-host .btn:hover {
  border-color: var(--paper);
  background: rgba(245, 240, 230, 0.09);
  color: var(--paper);
}

.lab-panel button.primary,
.lab-panel .btn.primary,
#lab-host button.primary,
#lab-host .btn.primary {
  border-color: var(--chartreuse);
  background: var(--chartreuse);
  color: #203e34;
}

.lab-panel button.primary:hover,
#lab-host button.primary:hover {
  border-color: #eef2ce;
  background: #eef2ce;
  color: #203e34;
}

.lab-panel :focus-visible,
#lab-host :focus-visible {
  outline-color: var(--chartreuse);
}

.lab-panel .row,
#lab-host .row {
  flex-wrap: wrap;
  gap: 9px;
}

.lab-readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 16px 12px;
  margin: 21px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--lab-rule);
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.lab-readout > * {
  min-width: 0;
  margin: 0;
}

.lab-readout b,
.lab-readout strong,
.lab-readout output,
.lab-readout dd {
  display: block;
  margin: 0 0 4px;
  color: var(--chartreuse);
  font-family: var(--display);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.lab-readout span,
.lab-readout small,
.lab-readout dt {
  color: #d2d9cc;
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.lab-readout p {
  margin: 0;
  font-size: 13px;
}

.lab-panel [role="status"],
#lab-host [role="status"] {
  color: var(--chartreuse);
}

.photo-story {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  align-items: start;
  gap: 25px 38px;
  margin: 54px 0;
}

.photo-story > * {
  min-width: 0;
}

.photo-story > h2,
.photo-story > h3,
.photo-story > p,
.photo-story > details,
.photo-story > :only-child {
  grid-column: 1 / -1;
}

.photo-story > h2,
.photo-story > h3 {
  margin-bottom: 0;
}

.photo-story img {
  width: 100%;
  height: clamp(240px, 32vw, 420px);
  object-fit: cover;
  object-position: center;
}

.photo-story p {
  max-width: 65ch;
  font-size: 16px;
  line-height: 1.75;
}

.photo-story figure + div,
.photo-story figure + article {
  padding-top: 5px;
}

.photo-story img[src$="assets/elements.jpg"],
.photo-story img[src$="assets/prism.png"],
.photo-story .artifact img,
.photo-story .extra-image img {
  height: clamp(210px, 28vw, 340px);
  padding: 20px;
  background: #eae3d4;
  object-fit: contain;
}

details {
  margin: 24px 0;
  padding: 17px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

details + details {
  margin-top: -25px;
  border-top: 0;
}

summary {
  min-height: 44px;
  padding: 9px 2px;
  color: var(--forest);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
}

summary::marker {
  color: var(--vermilion);
  font-size: 0.85em;
}

details[open] > summary {
  margin-bottom: 13px;
}

details p,
details li {
  max-width: 78ch;
  font-size: 15px;
  line-height: 1.75;
}

details > :last-child {
  margin-bottom: 0;
}

.source-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.source-list li {
  margin-bottom: 10px;
  padding-left: 3px;
}

.source-list a {
  overflow-wrap: anywhere;
}

.source-list small {
  color: var(--muted);
}

.image-credits,
.credits,
.sources {
  color: var(--muted);
  font-size: 13px;
}

.chapter-navigation,
.chapter-pagination,
.chapter-footer,
.prev-next,
#app > nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 13px 24px;
  margin-top: 44px;
  padding-top: 25px;
  border-top: 1px solid var(--rule);
}

.chapter-navigation button,
.chapter-pagination button,
.chapter-footer button,
.prev-next button,
#app > nav button {
  max-width: 100%;
  min-height: 46px;
}

.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

@media (min-width: 1000px) {
  .story-grid > .lab-panel,
  .story-grid > #lab-host,
  .story-grid > aside:has(.lab-panel),
  .story-grid > aside:has(#lab-host) {
    position: sticky;
    top: 101px;
  }
}

@media (max-width: 900px) {
  #site-header {
    padding-right: 24px;
    padding-left: 24px;
  }

  #app,
  #app.app {
    width: calc(100% - 48px);
  }

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

  .story-grid article > p,
  .story-grid .story > p,
  .story-grid .story-copy > p {
    max-width: 74ch;
  }

  .chapter-header {
    gap: 24px 32px;
  }

  .chapter-header > div {
    flex-basis: 360px;
  }

  .chapter-header > figure,
  .chapter-header > picture,
  .chapter-header > img {
    flex-basis: 190px;
    width: 190px;
  }

  .chapter-header img {
    height: 245px;
  }

  .chapter-grid {
    gap: 22px;
  }

  .portrait-triptych {
    height: 340px;
  }

  .photo-story {
    gap: 22px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
    line-height: 1.65;
  }

  html {
    scroll-padding-top: 130px;
  }

  #site-header,
  #site-header > .app {
    gap: 5px 8px;
  }

  #site-header {
    min-height: 0;
    padding: 8px 18px;
  }

  #home-link {
    justify-content: flex-start;
    min-height: 36px;
    padding: 4px 0;
    font-size: 21px;
  }

  #site-header nav,
  #site-header .chapter-nav {
    flex: 1 1 100%;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  #site-header nav button,
  #site-header nav a,
  #site-header [data-chapter] {
    flex: 1 1 0;
    padding: 9px 8px;
    font-size: 12px;
  }

  #app,
  #app.app {
    width: calc(100% - 36px);
    padding-top: 27px;
    padding-bottom: 45px;
  }

  #app > section + section {
    margin-top: 32px;
  }

  h1 {
    font-size: 44px;
    line-height: 1.06;
  }

  h2 {
    font-size: 32px;
  }

  .hero {
    margin-top: 4px;
    margin-bottom: 35px;
  }

  .hero h1 {
    max-width: 390px;
    margin-bottom: 14px;
  }

  .hero > p,
  .hero > header > p,
  .hero .dek {
    max-width: 330px;
    font-size: 18px;
  }

  .portrait-triptych {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    height: auto;
    margin: 22px auto 20px;
    padding: 8px 6px 16px;
    overflow: visible;
  }

  .portrait-triptych > * {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    height: auto;
    border-width: 3px;
    box-shadow: 0 5px 11px rgba(35, 43, 43, 0.13);
  }

  .portrait-triptych > :nth-child(n) {
    margin: 0;
    transform: none;
  }

  .portrait-triptych figure {
    height: auto;
  }

  .portrait-triptych img {
    height: clamp(130px, 36vw, 180px);
  }

  .portrait-triptych figcaption {
    position: static;
    align-self: center;
    padding: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .portrait-triptych figcaption strong,
  .portrait-triptych figcaption b {
    font-size: 16px;
  }

  #begin {
    min-height: 48px;
    padding: 12px 24px;
  }

  .chapter-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    margin: 28px 0;
  }

  .chapter-card,
  .chapter-card.card {
    padding: 21px 0 23px;
  }

  .chapter-card h2,
  .chapter-card h3 {
    margin-bottom: 8px;
    font-size: 31px;
  }

  .chapter-card p {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .chapter-card img {
    height: 220px;
    margin-bottom: 18px;
  }

  .timeline {
    gap: 16px 12px;
    margin-top: 27px;
    padding: 18px 0;
    font-size: 11px;
  }

  .timeline > * {
    flex-basis: 90px;
  }

  .timeline ol,
  .timeline ul {
    gap: 12px;
  }

  .timeline li {
    flex-basis: 85px;
  }

  .chapter-header {
    gap: 22px;
    margin-bottom: 28px;
    padding-bottom: 26px;
  }

  .chapter-header > div {
    flex: 1 1 100%;
  }

  .chapter-header > figure,
  .chapter-header > picture,
  .chapter-header > img {
    flex: 1 1 100%;
    width: 100%;
  }

  .chapter-header img {
    width: 100%;
    height: 220px;
    object-position: 50% 22%;
  }

  .chapter-header .dek,
  .chapter-header .lede {
    margin-top: 14px;
    font-size: 18px;
  }

  .story-grid {
    gap: 25px;
    margin-bottom: 35px;
  }

  .story-grid article > p,
  .story-grid .story > p,
  .story-grid .story-copy > p {
    line-height: 1.75;
  }

  .lab-panel,
  #lab-host {
    padding: 20px 17px;
  }

  .lab-panel h2,
  #lab-host h2 {
    font-size: 29px;
  }

  .lab-panel h3,
  #lab-host h3 {
    font-size: 26px;
  }

  .lab-panel svg,
  #lab-host svg {
    min-height: 210px;
    margin-top: 10px;
    margin-bottom: 12px;
  }

  .lab-controls {
    gap: 13px;
    margin-top: 12px;
  }

  .lab-readout {
    gap: 13px 10px;
    margin-top: 17px;
    padding-top: 16px;
  }

  .lab-readout b,
  .lab-readout strong,
  .lab-readout output,
  .lab-readout dd {
    font-size: 28px;
  }

  .photo-story {
    grid-template-columns: minmax(0, 1fr);
    gap: 23px;
    margin: 34px 0;
  }

  .photo-story img {
    height: 255px;
  }

  .photo-story img[src$="assets/elements.jpg"],
  .photo-story img[src$="assets/prism.png"],
  .photo-story .artifact img,
  .photo-story .extra-image img {
    height: 230px;
    padding: 15px;
  }

  .photo-story figure + div,
  .photo-story figure + article {
    padding-top: 0;
  }

  .takeaway,
  .connection {
    margin: 23px 0;
    padding-left: 17px;
  }

  .takeaway p,
  p.takeaway {
    font-size: 22px;
  }

  details {
    margin-top: 22px;
    margin-bottom: 22px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  details + details {
    margin-top: -23px;
  }

  .chapter-navigation,
  .chapter-pagination,
  .chapter-footer,
  .prev-next,
  #app > nav {
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
  }

  body > footer {
    padding: 19px 18px 24px;
    font-size: 11px;
  }
}

@media (max-width: 350px) {
  #site-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  #app,
  #app.app {
    width: calc(100% - 28px);
  }

  #site-header [data-chapter] {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 11px;
  }

  h1 {
    font-size: 40px;
  }

  .lab-panel,
  #lab-host {
    padding-right: 13px;
    padding-left: 13px;
  }

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

.is-paused,
.is-paused *,
.is-paused::before,
.is-paused::after,
.is-paused *::before,
.is-paused *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  html,
  body {
    background: #fff;
    color: #111;
  }

  #site-header {
    position: static;
    background: #fff;
    backdrop-filter: none;
  }

  #site-header nav,
  #begin,
  .lab-controls,
  .chapter-navigation,
  .chapter-pagination,
  .prev-next {
    display: none;
  }

  #app,
  #app.app {
    width: 100%;
    max-width: none;
    padding: 24px 0;
  }

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

  .story-grid > .lab-panel,
  .story-grid > #lab-host,
  .story-grid > aside {
    position: static;
  }

  .lab-panel,
  #lab-host,
  .portrait-triptych {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  figure,
  .lab-panel,
  #lab-host,
  .chapter-card {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }
}
