:root {
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

.theme-b {
  --b-bg: #0f1413;
  --b-text: #e0e8e2;
  --b-muted: #aab7af;
  --b-line: #2a3430;
  --b-panel: #151c1a;
  --b-accent: #82b7a7;
  --b-warm: #d3b36f;
  --b-soft: #c7d4cc;
  background: var(--b-bg);
  color: var(--b-text);
  padding-top: 3.85rem;
}

:root[data-theme="light"] .theme-b {
  --b-bg: #f6f7f3;
  --b-text: #17201d;
  --b-muted: #5d6964;
  --b-line: #d7ded8;
  --b-panel: #ffffff;
  --b-accent: #26705d;
  --b-warm: #965f16;
  --b-soft: #26352f;
}

.b-shell {
  width: min(1060px, calc(100% - 2rem));
  margin: 0 auto;
}

header.b-shell {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--b-line);
  background: color-mix(in srgb, var(--b-bg) 86%, transparent);
  color: var(--b-muted);
  backdrop-filter: blur(16px);
  view-transition-name: site-header;
}

header.b-shell a {
  text-decoration: none;
}

header.b-shell > a {
  min-height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--b-text);
  font-weight: 620;
}

.theme-b nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.9rem;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}

.theme-b nav::-webkit-scrollbar {
  display: none;
}

.theme-b nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0;
  text-decoration: none;
  white-space: nowrap;
}

.theme-b nav a[aria-current="page"] {
  color: var(--b-text);
  box-shadow: inset 0 -1px var(--b-accent);
}

.theme-b nav a:hover,
header.b-shell > a:hover {
  color: var(--b-accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.15rem;
  padding: 0.25rem 0;
  border: 0;
  background: transparent;
  color: var(--b-muted);
  cursor: pointer;
  font: inherit;
}

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

.toggle-track {
  width: 2.8rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem;
  border: 1px solid var(--b-line);
  border-radius: 999px;
  background: var(--b-panel);
}

.toggle-track span {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--b-accent);
  transform: translateX(0);
  transition: transform 160ms ease;
}

:root[data-theme="light"] .toggle-track span {
  transform: translateX(1.28rem);
}

.toggle-label {
  min-width: 2.2rem;
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border: 1px solid var(--b-accent);
  background: var(--b-panel);
  color: var(--b-text);
  text-decoration: none;
  transform: translateY(calc(-100% - 1rem));
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--b-accent);
  outline-offset: 3px;
}

.b-hero {
  display: grid;
  grid-template-columns: minmax(15rem, 0.34fr) minmax(0, 1fr);
  grid-template-areas: "profile intro";
  align-items: start;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(2rem, 5vw, 3.2rem) 0 clamp(2.2rem, 5vw, 3.8rem);
  scroll-margin-top: 5rem;
}

main.b-shell {
  view-transition-name: site-main;
}

.back-link {
  width: fit-content;
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--b-text);
}

@view-transition {
  navigation: auto;
}

::view-transition-old(site-main) {
  animation: 130ms ease-in both site-page-out;
}

::view-transition-new(site-main) {
  animation: 210ms 35ms ease-out both site-page-in;
}

@keyframes site-page-out {
  to {
    opacity: 0;
    transform: translateY(-0.2rem);
  }
}

@keyframes site-page-in {
  from {
    opacity: 0;
    transform: translateY(0.3rem);
  }
}

.b-status {
  margin-bottom: 0.9rem;
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.b-hero h1 {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(3rem, 6.8vw, 5.7rem);
  font-weight: 500;
  line-height: 0.94;
  text-transform: uppercase;
}

.b-hero-note {
  max-width: 48rem;
  margin-top: 1.2rem;
  color: var(--b-muted);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

.hero-action {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--b-muted);
  color: var(--b-text);
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
}

.hero-action:hover {
  border-color: var(--b-accent);
  color: var(--b-accent);
}

.hero-action-primary {
  border-color: var(--b-accent);
  background: var(--b-accent);
  color: var(--b-bg);
}

.hero-action-primary:hover {
  border-color: var(--b-text);
  background: var(--b-text);
  color: var(--b-bg);
}

.intro-panel {
  grid-area: intro;
}

.profile-card {
  grid-area: profile;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--b-line);
  border-bottom: 1px solid var(--b-line);
}

.profile-kicker {
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.profile-card dl {
  display: grid;
  gap: 0.82rem;
  margin: 0;
}

.profile-card dl > div {
  display: grid;
  gap: 0.25rem;
}

.profile-card dt {
  color: var(--b-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.profile-card dd {
  margin: 0;
  color: var(--b-text);
  line-height: 1.35;
}

.profile-card dd a {
  color: var(--b-text);
  text-decoration-color: color-mix(in srgb, var(--b-accent) 42%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.profile-card dd a:hover {
  color: var(--b-accent);
}

.profile-grid p {
  color: var(--b-muted);
  line-height: 1.55;
}

.profile-grid a,
.selected-work-main a,
.earlier-foundations a {
  color: var(--b-text);
  text-decoration-color: color-mix(in srgb, var(--b-accent) 42%, transparent);
  text-underline-offset: 0.18em;
}

.profile-grid a:hover,
.selected-work-main a:hover,
.earlier-foundations a:hover {
  color: var(--b-accent);
}

.b-section-title span,
.section-eyebrow,
.work-category,
.workstream-head span,
.selected-work-main span {
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.b-section {
  padding: clamp(2.35rem, 5vw, 4.25rem) 0;
  border-top: 1px solid var(--b-line);
  scroll-margin-top: 5rem;
}

#main {
  scroll-margin-top: 5rem;
}

.b-section-title {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: baseline;
  margin-bottom: 0.95rem;
}

.b-section h2 {
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  font-weight: 560;
  line-height: 1;
}

.section-eyebrow {
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.section-intro {
  max-width: 52rem;
  margin: 0 0 1.1rem 4rem;
  color: var(--b-muted);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  line-height: 1.55;
}

.workstream-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--b-line);
  list-style: none;
  counter-reset: workstream;
}

.workstream-list li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--b-line);
  counter-increment: workstream;
}

.workstream-list li::before {
  color: var(--b-warm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  content: counter(workstream, decimal-leading-zero);
}

.workstream-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.workstream-head span {
  font-size: 0.74rem;
  text-transform: uppercase;
}

.workstream-list p {
  grid-column: 2;
  max-width: 54rem;
  color: var(--b-muted);
  line-height: 1.55;
}

.question-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--b-line);
  background: var(--b-line);
  list-style: none;
  counter-reset: question;
}

.question-list li {
  min-height: 11.25rem;
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 0.9rem;
  background: var(--b-panel);
  counter-increment: question;
}

.question-list li::before {
  color: var(--b-warm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  content: counter(question, decimal-leading-zero);
}

.question-list p {
  color: var(--b-muted);
  line-height: 1.55;
}

.subsection-heading {
  margin: clamp(1.55rem, 4vw, 2.45rem) 0 0.75rem;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 560;
}

.selected-work-list {
  display: grid;
  border-top: 1px solid var(--b-line);
}

.selected-work-list article {
  display: grid;
  grid-template-columns: minmax(11rem, 0.28fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--b-line);
}

.work-category {
  font-size: 0.78rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.selected-work-main {
  display: grid;
  gap: 0.45rem;
}

.selected-work-main span {
  font-size: 0.78rem;
}

.selected-work-main p {
  max-width: 54rem;
  color: var(--b-muted);
  line-height: 1.55;
}

.selected-work-main a {
  width: fit-content;
}

.selected-outputs {
  margin-top: clamp(1.55rem, 4vw, 2.45rem);
}

.output-list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--b-line);
  list-style: none;
}

.output-list li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(10rem, 0.28fr);
  gap: 1rem;
  padding: 0.78rem 0;
  border-bottom: 1px solid var(--b-line);
}

.output-year,
.output-label {
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.output-main {
  display: grid;
  gap: 0.25rem;
}

.output-main a {
  color: var(--b-text);
  text-decoration-color: color-mix(in srgb, var(--b-accent) 42%, transparent);
  text-underline-offset: 0.18em;
}

.output-main a:hover {
  color: var(--b-accent);
}

.output-venue {
  color: var(--b-muted);
  line-height: 1.45;
}

.output-label {
  justify-self: end;
  text-align: right;
  text-transform: uppercase;
}

.earlier-foundations {
  margin-top: clamp(1.55rem, 4vw, 2.45rem);
}

.earlier-foundations details {
  border-top: 1px solid var(--b-line);
}

.earlier-foundations details:last-child {
  border-bottom: 1px solid var(--b-line);
}

.earlier-foundations summary {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  color: var(--b-text);
  cursor: pointer;
  list-style: none;
}

.earlier-foundations summary::-webkit-details-marker {
  display: none;
}

.earlier-foundations summary::before {
  color: var(--b-warm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  content: "+";
}

.earlier-foundations details[open] summary::before {
  content: "-";
}

.earlier-foundations summary span:first-child {
  grid-column: 2;
  font-weight: 620;
}

.earlier-foundations summary span:last-child {
  grid-column: 3;
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.earlier-foundations summary:hover,
.earlier-foundations summary:focus-visible {
  color: var(--b-accent);
}

.earlier-foundations details p {
  max-width: 54rem;
  padding: 0 0 1rem 1.6rem;
  color: var(--b-muted);
  line-height: 1.55;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--b-line);
  background: var(--b-line);
}

.profile-grid article {
  min-height: 7rem;
  padding: 0.85rem;
  background: var(--b-panel);
}

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

.route-grid article {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.route-grid article > a {
  width: fit-content;
}

.site-footer {
  padding: 0 0 clamp(1.6rem, 4vw, 2.35rem);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  border-top: 1px solid var(--b-line);
  padding-top: 1rem;
}

.contact-row a {
  color: var(--b-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  text-decoration: none;
}

.contact-row a:hover {
  color: var(--b-text);
}

.publication-links {
  margin-top: 1rem;
  color: var(--b-muted);
  line-height: 1.55;
}

.publication-links a {
  text-underline-offset: 0.18em;
}

.publication-links a:hover {
  color: var(--b-accent);
}

.section-actions {
  margin-left: 4rem;
}

#direction {
  scroll-margin-top: 9rem;
}

.site-meta {
  margin-top: 0.8rem;
  color: var(--b-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 8.25rem;
  }

  .theme-b {
    padding-top: 7.35rem;
  }

  .b-hero,
  .profile-grid,
  .question-list {
    grid-template-columns: 1fr;
  }

  header.b-shell {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 0.15rem;
  }

  header.b-shell > a {
    justify-self: start;
  }

  header.b-shell nav {
    grid-column: 1 / -1;
    order: 2;
  }

  .theme-toggle {
    justify-self: end;
  }

  header.b-shell > a,
  .theme-b nav a,
  .theme-toggle {
    min-height: 2.75rem;
  }

  .b-hero {
    grid-template-areas: "intro" "profile";
    min-height: auto;
    padding-top: 1.6rem;
  }

  .b-section-title,
  .workstream-list li,
  .selected-work-list article,
  .output-list li {
    grid-template-columns: 1fr;
  }

  .output-label {
    justify-self: start;
    text-align: left;
  }

  .b-section {
    padding: 2rem 0;
    scroll-margin-top: 9rem;
  }

  #main {
    scroll-margin-top: 9rem;
  }

  .question-list li,
  .profile-grid article {
    min-height: auto;
  }

  .section-intro,
  .section-actions {
    margin-left: 0;
  }

  .workstream-list p {
    grid-column: auto;
  }

  .earlier-foundations summary {
    grid-template-columns: 1.2rem minmax(0, 1fr);
    gap: 0.45rem 0.8rem;
  }

  .earlier-foundations summary span:first-child,
  .earlier-foundations summary span:last-child {
    grid-column: 2;
  }
}

@media (max-width: 420px) {
  .theme-b nav {
    gap: 0.75rem;
  }
}

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

  .toggle-track span {
    transition: none;
  }

  ::view-transition-old(site-main),
  ::view-transition-new(site-main) {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }
}
