/* Site experiments use the existing grid, type scale and surfaces. */
.lab-heading { padding-top: var(--s20); padding-bottom: var(--s8); }
.lab-heading h1 { max-width: 14ch; font-size: var(--hero); line-height: var(--hero-lh); }
.lab-heading > p { margin-top: var(--s3); max-width: 40ch; color: var(--paper-dim); }
.rule-row { padding-block: var(--s6); box-shadow: inset 0 1px 0 var(--line); align-items: start; row-gap: var(--s3); }
.rule-row__copy { grid-column: 1 / span 7; }
.rule-row__copy h2 { font: 500 var(--passage)/var(--passage-lh) var(--f-display); }
.rule-row__example { grid-column: 9 / -1; min-width: 0; }
.lab-demo { font: 400 var(--label)/var(--label-lh) var(--f-mono); min-width: 0; }
.lab-demo p { font: inherit; max-width: none; }
.lab-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1); }
.lab-button { display: inline-flex; justify-content: center; align-items: center; min-height: var(--s6); padding: var(--s1); box-shadow: inset 0 0 0 1px var(--paper-mute); background: var(--ink-2); font: 400 var(--label)/var(--label-lh) var(--f-mono); color: var(--paper); max-width: 100%; overflow-wrap: anywhere; }
.lab-button:active { transform: translateY(2px); }
.lab-button:hover { background-color: var(--ink-3); }
.lab-button.is-answered { background-color: var(--paper); color: var(--ink); }
.lab-status { min-height: calc(var(--label-lh) * 3); margin-top: var(--s1); color: var(--paper-dim); overflow-wrap: anywhere; }
.lab-caption { margin-top: var(--s2); color: var(--paper-dim); }
.lab-switch { display: flex; align-items: center; gap: var(--s1); min-height: var(--s6); font: 400 var(--label)/var(--label-lh) var(--f-mono); text-align: left; }
.lab-switch__track { position: relative; width: var(--s6); height: var(--s4); flex: none; box-shadow: inset 0 0 0 1px var(--paper-mute); border-radius: var(--s3); background: var(--ink-2); }
.lab-switch__track::before { content: ""; position: absolute; inset: var(--s1) auto auto var(--s1); width: var(--s2); height: var(--s2); background: var(--paper); border-radius: 50%; transform: translateX(0); transition: transform var(--press) var(--ease); }
.lab-switch[aria-checked="true"] .lab-switch__track::before { transform: translateX(var(--s2)); }
.lab-switch[aria-checked="true"] .lab-switch__track { background: var(--ink-3); }
.lab-switch:active .lab-switch__track { transform: scale(.96); }
.lab-demo [hidden] { display: none !important; }
.js-only { display: none; }
.js .js-only { display: block; }
.js .lab-pair.js-only { display: grid; }
.shift-box { height: var(--s30); overflow: hidden; padding: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.shift-box > p:first-child { margin-bottom: var(--s2); }
.shift-box__text { font-family: var(--f-mono); font-size: var(--label); line-height: var(--label-lh); }
.shift-box__text.is-late { transform: translateY(var(--s3)); font-family: var(--f-display); }
.shift-box--stable .shift-box__text { font-family: var(--f-display); }
.shift-replay { margin-top: var(--s2); }
.accent-samples { display: grid; gap: var(--s3); }
.accent-highlighter { width: max-content; max-width: 100%; background: var(--acid); color: var(--on-acid); padding-inline: var(--s1); }
.accent-focus { outline: 2px solid var(--accent-text); outline-offset: var(--s1); width: max-content; max-width: 100%; }
.accent-handle { display: flex; align-items: center; gap: var(--s1); }
.accent-handle::before { content: ""; width: var(--s1); height: var(--s3); background: var(--acid); }
.accent-link { display: inline-flex; min-height: var(--s6); align-items: center; text-decoration: underline; text-underline-offset: 4px; }
.accent-link:hover { color: var(--accent-text); }
.fish-rules { display: grid; gap: var(--s2); }
.credits { display: none; }
.credits h2 { font: 500 var(--passage)/var(--passage-lh) var(--f-display); }
.credits ul { display: grid; gap: var(--s1); margin-top: var(--s3); font: 400 var(--label)/var(--label-lh) var(--f-mono); color: var(--paper-dim); }
.lab-demo input { width: 100%; min-width: 0; min-height: var(--s6); border: 1px solid var(--paper-mute); border-radius: 0; background: var(--ink); color: var(--paper); padding: var(--s1); font: 400 var(--label)/var(--label-lh) var(--f-mono); }
.lab-demo label { display: block; }
.lab-demo button:focus-visible, .lab-demo input:focus-visible { outline: 2px solid var(--accent-text); outline-offset: var(--s1); }
/* Principles keep their scroll rail. Each demo stays inside its own panel. */
/* The behaviour page shares the portfolio's typography and open section rhythm. */
.colophon-page .lab-heading { padding-bottom: var(--s6); text-align: center; }
.colophon-page .lab-heading > p { margin-inline: auto; }
.colophon-page .lab-heading h1 {
  margin-inline: auto;
  max-width: 16ch;
  font-size: var(--h1);
  line-height: var(--h1-lh);
  text-wrap: balance;
}
.colophon-page #rules { padding-top: 0; }
.colophon-page .rule-row { padding-block: var(--s5); row-gap: var(--s3); }
.colophon-page .rule-row__copy,
.colophon-page .rule-row__example { grid-column: 1 / -1; }
.colophon-page .rule-row__copy h2 { font-weight: 600; max-width: 22ch; text-wrap: balance; }
.colophon-page .rule-row__example { max-width: 560px; font: 400 16px/24px var(--f-body); }
.colophon-page .rule-row__example > p:first-child { color: var(--paper-dim); }
.colophon-page .rule-row__example > .js-only { margin-top: var(--s2); }
.colophon-page .lab-pair { gap: var(--s2); }
.colophon-page .lab-button { border-radius: 8px; padding: 12px 16px; font: 500 16px/24px var(--f-body); }
.colophon-page .lab-pair .lab-button { width: 100%; }
.colophon-page .lab-switch { gap: 16px; font: 400 16px/24px var(--f-body); }
.colophon-page .lab-switch[aria-disabled="true"] { color: var(--paper-dim); cursor: default; }
.colophon-page .lab-status { min-height: 48px; font: 400 14px/24px var(--f-body); }
.colophon-page .shift-box { border-radius: 8px; padding: 16px; background: var(--ink-2); }
.colophon-page .shift-box__text { font-size: 16px; line-height: 24px; }
.colophon-page .accent-samples { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 24px 16px; padding: 8px; }
.colophon-page .accent-focus { min-height: 44px; border-radius: 4px; padding-inline: 8px; }
.colophon-page .credits ul { font: 400 16px/24px var(--f-body); gap: 12px; }
.colophon-page .end .link {
  padding-inline: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 6px;
  overflow: visible;
}
.colophon-page .end .link:hover,
.colophon-page .end .link:focus-visible { background: none; color: var(--accent-text); }
.colophon-page .end .link .arrow { background: none; border-radius: 0; }
@media (min-width: 768px) {
  .colophon-page .rule-row { padding-block: var(--s6); }
  .colophon-page .rule-row__copy { grid-column: 1 / span 7; }
  .colophon-page .rule-row__example { grid-column: 9 / -1; }
  .colophon-page .credits ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}

.people { --card-span: 15; --card-offset: 0; --card-pad: var(--s2); }
.principles-invitation {
  margin: var(--s2) auto 0;
  max-width: 46ch;
  color: var(--paper-dim);
  font: 400 14px/24px var(--f-body);
  text-align: center;
}
.principle-demo { grid-column: 1 / -1; margin-top: var(--s2); padding-top: var(--s2); box-shadow: inset 0 1px 0 var(--line); min-height: var(--s20); max-width: 480px; }
.principle .principle-demo p { margin-top: 0; font: 400 14px/24px var(--f-body); }
.principle .principle-demo .lab-status { margin-top: var(--s1); min-height: calc(var(--label-lh) * 2); }
.principle-demo .js-only { margin-top: var(--s1); }
.principle-demo .lab-switch { padding-block: 0; }
.principle-demo > p:first-child { color: var(--paper-dim); }
.principle-demo .lab-pair { gap: var(--s2); align-items: start; }
.principle-demo .lab-pair .lab-button { width: 100%; }
.principle-demo .lab-button,
.principle-demo input { border-radius: 8px; font: 500 14px/24px var(--f-body); padding-inline: 12px; }
.principle-demo input { background: var(--ink-2); }
.principle-demo .lab-switch { gap: 12px; font: 400 14px/24px var(--f-body); }
.principle-demo .lab-status { color: var(--paper-dim); }
.comparison-label {
  display: block;
  margin-bottom: var(--s1);
  color: var(--paper-dim);
  font: 500 12px/16px var(--f-body);
  text-transform: uppercase;
}
.principle-demo--quiet {
  display: grid;
  align-content: center;
  min-height: 128px;
  color: var(--paper-dim);
}
.principle-demo [aria-invalid="true"] { border-color: var(--paper); }
.principle-demo [data-principle-phone-fix] { margin-top: 8px; }
.rail-on .people .stage { justify-content: flex-start; padding-top: calc(var(--s10) + var(--s1)); padding-bottom: var(--s12); }
.rail-on .people .rail { margin-top: var(--s3); }
.rail-on .principle { min-height: 0; padding-bottom: var(--s2); }
.rail-on .principle h3 { margin-top: var(--s1); font-size: var(--principle); line-height: var(--principle-lh); max-width: 22ch; }
.rail-on .principle > p { margin-top: var(--s1); padding-top: 0; font-size: var(--text); line-height: var(--text-lh); }
.rail-on .principle-demo { width: 100%; flex: none; margin-top: var(--s2); }
.shape-buttons { display: none; gap: var(--s2); align-items: center; padding: 16px 0; }
.js .shape-buttons.js-only { display: flex; }
.shape-button { width: var(--s8); height: var(--s6); flex: 1; border-radius: 8px; background: var(--paper-dim); transition: transform var(--press) var(--ease); }
.shape-button--outline { background: none; box-shadow: inset 0 0 0 1px var(--paper-mute); }
.shape-button--raised { background: var(--paper); box-shadow: 0 var(--s1) var(--s2) rgb(0 0 0 / .24); border-radius: var(--s1); }
.shape-button:active, .shape-button.is-pressed { transform: translateY(2px); }
.guess-screen { position: relative; height: 128px; border-radius: 8px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.guess-screen__content { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 32px 1fr 32px; gap: 0 var(--s1); padding: 12px; align-items: center; pointer-events: none; }
.guess-screen__content > span:first-child { grid-column: 1 / -1; font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.guess-screen__content > span:nth-child(3) { color: var(--paper-dim); }
.guess-screen.is-hidden .guess-screen__content { filter: blur(6px); }
.guess-save { grid-column: 2; grid-row: 3; justify-self: end; border-radius: 4px; background: var(--paper); color: var(--ink); padding: 4px 16px; }
.guess-target { position: absolute; width: 50%; height: 50%; z-index: 2; touch-action: pan-y; }
.guess-target[data-guess="0"] { left: 0; top: 0; }
.guess-target[data-guess="1"] { right: 0; top: 0; }
.guess-target[data-guess="2"] { left: 0; bottom: 0; }
.guess-target[data-guess="3"] { right: 0; bottom: 0; }
.guess-target:focus-visible { outline-offset: -2px; }
.guess-marker { position: absolute; z-index: 3; width: var(--s2); height: var(--s2); border: 1px solid var(--paper); border-radius: 50%; translate: -50% -50%; pointer-events: none; }
.guess-footer { display: none; gap: var(--s2); align-items: start; }
.principle .guess-footer .lab-status { margin-top: 0; }
.js .guess-footer.js-only { display: flex; }
.guess-footer .lab-button { flex: none; }
.send-line { height: var(--s1); margin-top: var(--s1); box-shadow: inset 0 -1px var(--line); overflow: hidden; }
.send-line > span { display: block; width: 100%; height: 2px; background: var(--paper); transform: scaleX(0); transform-origin: left; }
.feel-switch { justify-content: center; width: 100%; min-height: 64px; border-block: 1px solid var(--line); }
.feel-switch--late:active .lab-switch__track { transform: none; }
.feel-switch--late .lab-switch__track::before { transition: none; }
@media (min-width: 768px) {
  .people { --card-span: 13; }
  .rail-on .people .stage { padding-top: var(--s15); padding-bottom: var(--s3); }
  .principle-demo { grid-column: 4 / -1; }
}
@media (min-width: 1280px) {
  .people { --card-span: 10; }
  .principle-demo { grid-column: 6 / -1; }
}
@media (min-width: 768px) and (max-height: 800px) {
  .rail-on .people .rail { margin-top: var(--s2); }
}

/* Museum rows keep the same 5 / 11 division at every width. */
.failures--editorial .failures-heading { margin-bottom: var(--s12); }
.failures--editorial .exhibit {
  min-height: 72svh;
  padding-block: var(--s12);
  align-items: center;
  box-shadow: inset 0 1px 0 var(--line);
}
.failures--editorial .exhibit__placard { grid-column: 1 / span 5; }
.failures--editorial .exhibit__number {
  color: var(--accent-text);
  font: 500 14px/24px var(--f-body);
}
.failures--editorial .exhibit__placard h3 {
  margin-block: var(--s2);
  max-width: 15ch;
  font: 600 var(--h2)/var(--h2-lh) var(--f-display);
  text-wrap: balance;
}
.failures--editorial .exhibit__placard > p:not(.exhibit__number) {
  max-width: 34ch;
  font: 400 var(--text)/var(--text-lh) var(--f-body);
}
.failures--editorial .exhibit__lesson {
  margin-top: var(--s3);
  color: var(--paper);
  font-weight: 500 !important;
}
.exhibit-scene {
  grid-column: 7 / -1;
  position: relative;
  min-height: 360px;
  color: var(--paper);
  padding-bottom: 96px;
}
.study-action {
  position: absolute;
  left: 0;
  bottom: 40px;
  min-height: 48px;
  padding-inline: var(--s2);
  border: 1px solid var(--paper-mute);
  border-radius: 8px;
  color: var(--paper);
  font: 500 16px/24px var(--f-body);
}
.study-action:hover,
.study-action:focus-visible { border-color: var(--accent-text); color: var(--accent-text); }
.study-result {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 24px;
  color: var(--accent-text);
  font: 400 14px/24px var(--f-body);
}
.door-study { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: var(--s6); }
.door-study__word { position: absolute; top: 32px; left: 16%; font: 600 var(--h2)/1 var(--f-display); }
.door-study__handle { justify-self: center; width: 40px; height: 184px; border: 12px solid var(--paper); border-radius: 24px; box-shadow: 12px 12px 24px rgb(0 0 0 / .3); }
.door-study__plate { justify-self: center; width: 112px; height: 232px; border-radius: 8px; background: var(--paper-dim); }
.door-study__conflict { position: absolute; left: 50%; bottom: 16px; translate: -50% 0; color: var(--paper-dim); white-space: nowrap; }
.form-study { display: grid; align-content: center; gap: var(--s2); max-width: 640px; }
.form-study span { display: grid; grid-template-columns: 112px 1fr; padding-block: var(--s2); border-bottom: 1px solid var(--line); color: var(--paper-dim); }
.form-study b { color: var(--paper); font-weight: 400; }
.form-study i { margin-top: var(--s2); color: var(--accent-text); font-style: normal; }
.lift-study { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: 1fr auto; align-items: center; justify-items: center; }
.lift-study__silent, .lift-study__answered { display: grid; place-items: center; width: 128px; aspect-ratio: 1; border: 1px solid var(--paper-mute); border-radius: 50%; font: 500 var(--h2)/1 var(--f-display); }
.lift-study__answered { background: var(--acid); color: var(--on-acid); border-color: var(--acid); }
.lift-study__line { width: 96px; height: 1px; background: var(--line); }
.lift-study > p:not(.study-result) { grid-column: 3; color: var(--accent-text); opacity: .18; transition: opacity 300ms var(--ease); }
.password-study { display: grid; align-content: center; gap: var(--s3); max-width: 560px; }
.password-study__field { padding: var(--s2); border-bottom: 1px solid var(--paper); font-size: var(--h2); letter-spacing: 0; }
.password-study ul { display: flex; gap: var(--s3); color: var(--paper-dim); }
.password-study li::before { content: "✓ "; color: var(--accent-text); }
.password-study strong { font-weight: 500; }
.digits-study { display: grid; grid-template-columns: 1fr auto 1fr; align-content: center; align-items: center; gap: var(--s3); text-align: center; }
.digits-study span { font: 600 var(--h2)/var(--h2-lh) var(--f-display); }
.digits-study i { color: var(--paper-dim); font-style: normal; }
.digits-study strong { grid-column: 3; color: var(--accent-text); font-weight: 500; }
.door-study__plate,
.form-study i,
.password-study ul,
.password-study strong,
.digits-study strong { opacity: .18; transition: opacity 300ms var(--ease); }
.door-study__handle { transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
.exhibit-scene.is-revealed .door-study__handle { opacity: .25; transform: translateX(-16px); }
.exhibit-scene.is-revealed .door-study__plate,
.exhibit-scene.is-revealed.form-study i,
.exhibit-scene.is-revealed.password-study ul,
.exhibit-scene.is-revealed.password-study strong,
.exhibit-scene.is-revealed.digits-study strong,
.exhibit-scene.is-revealed.lift-study > p:not(.study-result) { opacity: 1; }
.exhibit-scene.is-revealed .lift-study__silent { opacity: .3; }
.exhibit-scene.is-revealed .form-study span { color: var(--paper-dim); }
.exhibit-scene.is-revealed .study-action { color: var(--paper-dim); }
@media (max-width: 767px) {
  .failures--editorial .exhibit { min-height: 0; padding-block: var(--s10); row-gap: var(--s6); }
  .failures--editorial .exhibit__placard,
  .exhibit-scene { grid-column: 1 / -1; }
  .exhibit-scene { min-height: 280px; }
  .door-study { gap: var(--s2); }
  .door-study__handle { height: 136px; }
  .door-study__plate { width: 80px; height: 176px; }
  .lift-study__silent, .lift-study__answered { width: 88px; }
  .lift-study__line { width: 32px; }
  .digits-study { grid-template-columns: 1fr; }
  .digits-study strong { grid-column: 1; }
}

.failures-heading { margin-bottom: var(--s8); text-align: center; }
.failures-heading h2 { margin-top: var(--s3); margin-inline: auto; max-width: 16ch; font-size: var(--h1); line-height: var(--h1-lh); }
.failures-heading > p:last-child { margin-top: var(--s3); margin-inline: auto; max-width: 56ch; color: var(--paper-dim); }
.exhibit { align-items: start; padding-block: var(--s6); box-shadow: inset 0 1px 0 var(--line); }
.exhibit__placard { grid-column: 1 / span 5; min-width: 0; font: 400 var(--text)/var(--text-lh) var(--f-body); overflow-wrap: anywhere; }
.exhibit__placard h3 { margin-block: var(--s2); font: 600 var(--principle)/var(--principle-lh) var(--f-display); text-wrap: balance; }
.exhibit__placard > p + p { margin-top: var(--s2); }
.exhibit__placard .todo { padding-inline: 0; border-radius: 0; }
.exhibit__fix-note { visibility: hidden; color: var(--paper-dim); }
.exhibit.is-fixed .exhibit__fix-note { visibility: visible; }
.exhibit__panel { grid-column: 6 / -1; min-width: 0; padding: var(--s2); background: var(--ink-2); }
.failures .exhibit__panel.surface::before { display: none; }
.failures .exhibit__panel,
.failures .lab-button,
.failures .lab-demo input,
.failures .door-face,
.failures .door-control--plate,
.failures .door-control--handle > span { border-radius: var(--s1); }
.exhibit__panel label { margin-top: var(--s1); }
.exhibit__panel input { margin-top: var(--s1); }
.exhibit__panel form > .lab-button { margin-top: var(--s2); width: 100%; }
.exhibit__panel [data-exhibit-fix] { margin-top: var(--s2); }
.exhibit__panel .demo-instruction {
  margin-bottom: var(--s2);
  color: var(--paper);
  font: 500 16px/24px var(--f-body);
}
.exhibit__panel [data-exhibit-fix] {
  width: 100%;
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
}
.exhibit__fallback { color: var(--paper-dim); }
.js .exhibit__fallback { display: none; }
.field-error { min-height: calc(var(--label-lh) * 3); color: var(--paper); overflow-wrap: anywhere; }
.door-sign { min-height: var(--s4); text-align: center; }
.door-face { position: relative; height: var(--s20); width: 100%; box-shadow: inset 0 0 0 1px var(--paper-mute); background: var(--ink); transform-origin: left center; transition: transform var(--press) var(--ease); }
.door-face.is-pulled { transform: perspective(400px) rotateY(-16deg); }
.door-face.is-pushed { transform: perspective(400px) rotateY(8deg); }
.door-control { position: absolute; right: var(--s2); top: var(--s5); width: var(--s6); height: var(--s10); }
.door-control--handle > span { display: block; margin: auto; width: var(--s2); height: var(--s8); border: var(--s1) solid var(--paper); box-shadow: var(--s1) 0 var(--s2) rgb(0 0 0 / .24); }
.door-control--plate { width: var(--s8); background: var(--paper-dim); box-shadow: inset 0 0 0 1px var(--paper); }
.exhibit.is-fixed .door-sign { visibility: hidden; }
.lift-button { display: grid; place-items: center; width: var(--s8); height: var(--s8); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--paper-mute); background: var(--ink); font: 400 var(--h2)/var(--h2-lh) var(--f-display); }
.lift-button.is-called { background: var(--paper); color: var(--ink); }
.lift-count { min-height: var(--label-lh); }
.exhibit.is-fixed .lift-count { visibility: hidden; }
.password-rules { margin-block: var(--s2); visibility: hidden; min-height: calc(var(--label-lh) * 2); }
.password-rules.is-visible { visibility: visible; }
.failures::before, .colophon-page .section::before { display: none; }
.shift-box > p:first-child { overflow-wrap: anywhere; }
.lab-switch[aria-disabled="true"] { color: var(--paper-dim); cursor: default; }
.lab-switch[aria-disabled="true"]:active .lab-switch__track { transform: none; }

/* The footer link group takes the row "Back to the top" had on phones. */
@media (max-width: 767px) {
  .contact .end > .footer-links { flex-basis: 100%; }
}
