:root {
  --bg: #f7f0e1;
  --ink: #2a2318;
  --ink-soft: #5e5340;
  --ink-faint: #948871;
  --rule: #e2d8c1;
  --rule-strong: #b8a888;
  --panel: #efe5cf;
  --accent: #2a2318;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --page: 1400px;
  color-scheme: light;

  /* warm brown dark palette, applied by the two selectors below */
  --dark-bg: #1d1510;
  --dark-ink: #f6ebdc;
  --dark-ink-soft: #cdb9a0;
  --dark-ink-faint: #9c876d;
  --dark-rule: #3c2d20;
  --dark-rule-strong: #6b5238;
  --dark-panel: #2a2017;
}

/* Dark applies on an explicit choice, or on the device default when no choice
   has been made. */
:root[data-theme="dark"] {
  --bg: var(--dark-bg);
  --ink: var(--dark-ink);
  --ink-soft: var(--dark-ink-soft);
  --ink-faint: var(--dark-ink-faint);
  --rule: var(--dark-rule);
  --rule-strong: var(--dark-rule-strong);
  --panel: var(--dark-panel);
  --accent: var(--dark-ink);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"],
  :root:not([data-theme]) {
    --bg: var(--dark-bg);
    --ink: var(--dark-ink);
    --ink-soft: var(--dark-ink-soft);
    --ink-faint: var(--dark-ink-faint);
    --rule: var(--dark-rule);
    --rule-strong: var(--dark-rule-strong);
    --panel: var(--dark-panel);
    --accent: var(--dark-ink);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0 20px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main,
footer {
  max-width: var(--page);
  margin: 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 0.15s ease;
}

a:hover {
  border-bottom-color: var(--ink);
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: flex;
  border: 1px solid var(--rule);
}

.theme-toggle button {
  display: flex;
  padding: 7px 10px;
  background: none;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle button + button {
  border-left: 1px solid var(--rule);
}

.theme-toggle button:hover {
  color: var(--ink-soft);
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
}

/* ---------- hero ---------- */

.hero {
  padding: 120px 0 48px;
  max-width: 680px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 40px;
}

.lede {
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.currently {
  list-style: none;
  margin: 0 0 44px;
  padding: 0;
}

.hero .currently:last-child {
  margin-bottom: 0;
}

.currently li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--rule);
}

.currently li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 36px 0 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- sections ---------- */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--rule);
}

.section-head {
  margin: 0 0 40px;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 64px;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.04em;
}

.section-body {
  max-width: 640px;
}

.callout {
  background: var(--panel);
  padding: 20px 22px;
  margin: 0 0 36px;
  color: var(--ink-soft);
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 24px;
}

.aside {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 32px 0 0;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 18px 0 18px 44px;
  border-bottom: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 19px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-faint);
}

.steps h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- rules ---------- */

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

.rules li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 15px;
}

.rule-label {
  color: var(--ink);
  font-weight: 600;
}

blockquote {
  margin: 36px 0 0;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--ink);
}

blockquote p {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  margin: 0;
}

/* ---------- people ---------- */

.people-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0 48px;
  max-width: none;
  align-items: start;
  scroll-margin-top: 40px;
}

.people-callout {
  grid-column: 1;
  grid-row: 1;
}

.people-list {
  grid-column: 1;
  grid-row: 2;
}

.people-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.people-nav-slot {
  flex: 1;
  min-height: 0;
}

.people-nav {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  background: var(--bg);
  position: sticky;
  top: calc(100dvh - var(--people-nav-h, 5.5rem) - 20px);
}

.people-nav-button {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  background: none;
  border: 1px solid var(--rule-strong);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

#peopleNext {
  text-align: right;
}

.people-nav-button:disabled {
  color: var(--ink-faint);
  border-color: var(--rule);
  cursor: default;
}

.people-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.people-list li + li {
  margin-top: 2px;
}

.person-button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 7px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  font: inherit;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: color 0.15s ease;
}

.person-button:hover,
.person-button:focus-visible {
  color: var(--ink);
}

.person-button[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
}

.person-name {
  min-width: 0;
}

.person-leader {
  flex: 1;
  height: 1px;
  background: var(--rule);
  transform: translateY(-3px);
}

.person-year {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  font-size: 14px;
}

.detail-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.detail-role {
  font-family: var(--serif);
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 24px;
}

.detail-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0 0 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-photo img,
.detail-photo video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.detail-photo--empty::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
}

.detail-story p {
  margin: 0 0 1em;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}

.detail-story p:last-child {
  margin-bottom: 0;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: center;
  padding: 48px 0 72px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-faint);
}

footer p {
  margin: 0;
}

footer .links {
  margin: 0;
}

.footer-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .section-head {
    margin-bottom: 28px;
  }

  .section-head h2 {
    font-size: 54px;
  }

  .people-callout,
  .people-list,
  .people-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .people-callout {
    order: 1;
    margin-bottom: 0;
  }

  .people-panel {
    display: block;
    order: 2;
  }

  .people-nav {
    position: static;
    margin-top: 24px;
    padding-top: 0;
  }

  .people-detail {
    scroll-margin-top: 36px;
  }

  .people-list {
    order: 3;
  }

  .people-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 36px;
    scroll-margin-top: 28px;
  }

  .detail-photo {
    max-height: 400px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0 20px;
  }

  .hero {
    padding: 72px 0 36px;
  }

  .section {
    padding: 52px 0;
  }

  .detail-title {
    font-size: 30px;
  }
}
