:root {
  --page: #f5f6f4;
  --surface: #ffffff;
  --surface-subtle: #eef1ef;
  --surface-code: #172126;
  --ink: #1d272c;
  --muted: #5e696e;
  --line: #cdd3d1;
  --line-strong: #9ca8a7;
  --accent: #315f7a;
  --accent-soft: #e2edf2;
  --success: #245b47;
  --success-soft: #e1eee7;
  --warning: #6b5527;
  --warning-soft: #f2ebd8;
  --projection: #68537e;
  --projection-soft: #eee8f3;
  --radius: 0.45rem;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible + span {
  outline: 3px solid #2d6e95;
  outline-offset: 3px;
}

pre {
  margin: 0;
  overflow: auto;
  scrollbar-color: #52636b var(--surface-code);
}

code {
  font-family: var(--mono);
}

[hidden] {
  display: none !important;
}

.shell,
.site-header,
.site-footer {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--ink);
  transform: translateY(-180%);
}

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

.site-header {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: var(--surface);
  border-radius: 0.22rem;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 1.7rem);
  font-size: 0.78rem;
  font-weight: 650;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.intro {
  padding-block: clamp(3.5rem, 8vw, 7rem) clamp(3rem, 6vw, 5rem);
}

.prototype-banner {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.01em;
}

.prototype-banner strong,
.prototype-banner span {
  padding: 0.45rem 0.68rem;
}

.prototype-banner strong {
  color: var(--surface);
  background: var(--ink);
  font-weight: 650;
}

.prototype-banner span {
  color: var(--warning);
  background: var(--warning-soft);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.65fr);
  align-items: start;
  gap: clamp(3rem, 8vw, 7rem);
}

.kicker,
.panel-kicker,
.scenario-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 50rem;
  margin: 0.8rem 0 0;
  font-size: clamp(2.5rem, 5.6vw, 4.8rem);
  font-weight: 610;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.lede {
  max-width: 47rem;
  margin: 1.75rem 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  line-height: 1.7;
}

.scope-note {
  padding: 1.25rem;
  border-top: 3px solid var(--ink);
  background: var(--surface-subtle);
}

.scope-note h2 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.scope-note ul {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: #435057;
  font-size: 0.84rem;
}

.scope-note p {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.page-index {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-index a {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.page-index a + a {
  border-left: 1px solid var(--line);
}

.page-index a:hover {
  background: var(--surface);
}

.page-index span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.worked-example,
.surface-section,
.related-section {
  border-block: 1px solid var(--line);
  background: var(--surface-subtle);
}

.worked-example,
.interpretation,
.surface-section,
.questions,
.related-section {
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.42fr);
  align-items: end;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.section-header--compact {
  grid-template-columns: 1fr;
}

.section-header h2 {
  margin: 0.65rem 0 0;
  font-size: clamp(2rem, 4.5vw, 3.45rem);
  font-weight: 610;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-header > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.scenario-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
}

.scenario-label {
  padding: 0.25rem 0.42rem;
  color: var(--surface);
  border-radius: 0.2rem;
  background: var(--accent);
}

.scenario-note blockquote {
  margin: 0;
  font-size: 1rem;
}

.scenario-note > p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.demo {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

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

.demo-panel {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.demo-panel--requests {
  border-right: 1px solid var(--line);
}

.demo-panel--trace {
  background: #fafbfa;
}

.panel-header {
  min-height: 4.6rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel-header h3,
.timeline-header h3,
.inspection h3 {
  margin: 0.25rem 0 0;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.panel-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.fixed-badge,
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  padding: 0.3rem 0.48rem;
  color: var(--success);
  border: 1px solid #9fbcad;
  border-radius: 99rem;
  background: var(--success-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.25;
}

.profile-calls,
.backend-trace {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-call {
  overflow: hidden;
  border: 1px solid #34434a;
  border-radius: var(--radius);
  background: var(--surface-code);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.profile-call.is-revealed {
  border-color: #80a8ba;
  box-shadow: 0 0 0 2px rgb(49 95 122 / 0.15);
}

.call-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  color: #f1f5f5;
  border-bottom: 1px solid #34434a;
}

.call-heading span,
.trace-number {
  color: #9cabb0;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.call-heading code {
  font-size: 0.75rem;
}

.profile-call pre {
  padding: 0.9rem;
  color: #dbe6e6;
  font-size: 0.69rem;
  line-height: 1.65;
}

.backend-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
}

.backend-switcher legend {
  width: 100%;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.backend-switcher label {
  min-width: 0;
  cursor: pointer;
}

.backend-switcher input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.backend-switcher label > span {
  min-height: 3.6rem;
  display: grid;
  align-content: center;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.backend-switcher strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.backend-switcher small {
  font-size: 0.66rem;
}

.backend-switcher input:checked + span {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.backend-switcher input:disabled + span {
  cursor: wait;
  opacity: 0.65;
}

.trace-step {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.trace-step.is-revealed {
  border-color: #80a8ba;
  box-shadow: 0 0 0 2px rgb(49 95 122 / 0.12);
}

.trace-row {
  min-height: 2.65rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.7rem;
}

.trace-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.7rem;
}

.trace-kind {
  padding: 0.2rem 0.35rem;
  border-radius: 0.2rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  line-height: 1.2;
}

.trace-kind--direct {
  color: var(--success);
  background: var(--success-soft);
}

.trace-kind--upstream {
  color: var(--warning);
  background: var(--warning-soft);
}

.trace-kind--projection {
  color: var(--projection);
  background: var(--projection-soft);
}

.trace-step details {
  border-top: 1px solid var(--line);
}

.trace-step summary {
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.63rem;
  cursor: pointer;
}

.trace-step summary:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.trace-json-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.trace-json-grid > div {
  min-width: 0;
}

.trace-json-grid > div + div {
  border-left: 1px solid var(--line);
}

.trace-json-label {
  display: block;
  padding: 0.4rem 0.55rem;
  color: var(--muted);
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 0.55rem;
  text-transform: uppercase;
}

.trace-json-grid pre {
  min-height: 7rem;
  padding: 0.6rem;
  color: #dbe6e6;
  background: var(--surface-code);
  font-size: 0.58rem;
  line-height: 1.55;
}

.demo-control-bar {
  min-height: 4.8rem;
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.button {
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--ink);
}

.button--run,
.button--primary {
  color: var(--surface);
  border-color: var(--ink);
  background: var(--ink);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.demo-control-bar > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.calendar-result {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.timeline-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-header > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0 0.3rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.timeline-track {
  height: 6.4rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfa;
}

.timeline-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.timeline-grid i + i {
  border-left: 1px solid var(--line);
}

.calendar-block {
  min-width: 4rem;
  position: absolute;
  top: 0.8rem;
  bottom: 0.8rem;
  display: grid;
  align-content: center;
  gap: 0.08rem;
  padding: 0.45rem 0.55rem;
  overflow: hidden;
  border-left: 3px solid;
  font-size: 0.66rem;
}

.calendar-block strong,
.calendar-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-block span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
}

.calendar-block--busy {
  border-color: #879495;
  background: #e4e8e7;
}

.calendar-block--booked {
  z-index: 2;
  border-color: var(--success);
  background: var(--success-soft);
}

.calendar-block--roadmap {
  left: 0;
  width: 25%;
}

.calendar-block--focus {
  left: 37.5%;
  width: 12.5%;
}

.calendar-block--booked {
  left: 50%;
  width: 18.75%;
}

.outcome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #9fbcad;
  border-radius: var(--radius);
  background: var(--success-soft);
}

.outcome-check {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--success);
  font-size: 0.72rem;
}

.outcome div {
  display: grid;
}

.outcome div span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.outcome div strong {
  font-size: 0.82rem;
}

.outcome time {
  color: var(--success);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.noscript-result {
  margin-top: 1rem;
  padding: 0.8rem;
  color: #435057;
  border-left: 3px solid var(--warning);
  background: var(--warning-soft);
  font-size: 0.78rem;
}

.noscript-result p {
  margin: 0;
}

.noscript-result p + p {
  margin-top: 0.45rem;
}

.simulation-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.85rem clamp(1.25rem, 3vw, 2rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

.simulation-note span {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.6rem;
}

.boundary-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.boundary-pair article {
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--surface);
}

.boundary-pair h3,
.surface-grid h3,
.related-grid h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.boundary-pair ul,
.related-grid ul {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: #435057;
  font-size: 0.86rem;
}

.inspection {
  display: grid;
  grid-template-columns: minmax(13rem, 0.35fr) minmax(0, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}

.inspection-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.inspection-links a {
  display: grid;
  gap: 0.18rem;
  padding: 0.75rem 0.8rem;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.inspection-links a:hover {
  border-color: var(--accent);
}

.inspection-links strong {
  font-size: 0.78rem;
}

.inspection-links span {
  color: var(--muted);
  font-size: 0.68rem;
}

.surface-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.surface-facts div {
  min-width: 0;
  padding: 0.9rem 1rem;
}

.surface-facts div:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}

.surface-facts div:not(:nth-child(3n + 1)) {
  border-left: 1px solid var(--line);
}

.surface-facts dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.surface-facts dd {
  margin: 0.3rem 0 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 650;
}

.surface-facts code {
  font-size: 0.72rem;
}

.surface-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: var(--line);
}

.surface-grid article {
  padding: 1.25rem;
  background: var(--surface);
}

.code-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.code-list code {
  display: block;
  padding: 0.45rem 0.5rem;
  overflow-wrap: anywhere;
  color: #34444b;
  background: var(--surface-subtle);
  font-size: 0.65rem;
}

.surface-grid article > p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.question-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.question-list li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.question-list span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.question-list p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: -0.015em;
}

.discussion-link {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 650;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.related-grid article {
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--surface);
}

.related-grid p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

.site-footer strong {
  color: var(--ink);
}

.status-dot {
  width: 0.48rem;
  height: 0.48rem;
  display: inline-block;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--warning);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
}

.not-found {
  min-height: calc(100vh - 11rem);
  display: grid;
  place-content: center;
  justify-items: start;
  padding-block: 5rem;
}

.not-found .eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.not-found h1 {
  max-width: 45rem;
  margin: 0.65rem 0 0;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.not-found > p:not(.eyebrow) {
  max-width: 38rem;
  margin: 1.25rem 0;
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .intro-grid,
  .section-header,
  .inspection {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .scope-note {
    max-width: 42rem;
  }

  .page-index {
    grid-template-columns: 1fr 1fr;
  }

  .page-index a:nth-child(3) {
    border-left: 0;
  }

  .page-index a:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }

  .demo-panel--requests {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-calls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .shell,
  .site-header,
  .site-footer {
    width: min(100% - 1.25rem, 72rem);
  }

  .site-header {
    min-height: auto;
    align-items: flex-start;
    padding-block: 0.85rem;
  }

  .site-header nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.8rem;
  }

  .site-header nav a:last-child {
    display: none;
  }

  .intro h1 {
    font-size: clamp(2.3rem, 12vw, 3.5rem);
  }

  .prototype-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .prototype-banner strong,
  .prototype-banner span {
    text-align: center;
  }

  .page-index,
  .profile-calls,
  .boundary-pair,
  .surface-grid,
  .related-grid,
  .inspection-links {
    grid-template-columns: 1fr;
  }

  .page-index a + a,
  .page-index a:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .section-header {
    margin-bottom: 1.7rem;
  }

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

  .scenario-note > p {
    grid-column: 1 / -1;
  }

  .demo-panel {
    padding: 1rem;
  }

  .panel-header {
    min-height: 0;
  }

  .backend-switcher,
  .trace-json-grid {
    grid-template-columns: 1fr;
  }

  .trace-json-grid > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .demo-control-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.65rem;
  }

  .match-badge {
    width: fit-content;
  }

  .timeline-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-track {
    height: 8rem;
  }

  .calendar-block {
    min-width: 2.5rem;
    padding: 0.35rem;
  }

  .calendar-block strong {
    font-size: 0.58rem;
  }

  .calendar-block span {
    display: none;
  }

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

  .outcome time {
    grid-column: 2;
  }

  .surface-facts {
    grid-template-columns: 1fr 1fr;
  }

  .surface-facts div:nth-child(n) {
    border-top: 0;
    border-left: 0;
  }

  .surface-facts div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .surface-facts div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .code-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 1.5rem;
  }
}

@media (max-width: 420px) {
  .wordmark > span:last-child {
    display: none;
  }

  .surface-facts {
    grid-template-columns: 1fr;
  }

  .surface-facts div:nth-child(n) {
    border-left: 0;
  }

  .surface-facts div + div {
    border-top: 1px solid var(--line);
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .page-index,
  .demo-control-bar {
    display: none;
  }

  body,
  .worked-example,
  .surface-section,
  .related-section {
    background: white;
  }

  .intro,
  .worked-example,
  .interpretation,
  .surface-section,
  .questions,
  .related-section {
    padding-block: 2rem;
  }
}
