/* Studio Jio. The command line in the bar, shared by the home page and the
   case studies. The line says where you are; pressing it lists where you can
   go. It is a <details> element, so it opens and closes without JavaScript.
   Colours come from whichever page it is on: the studies' chrome values when
   they exist, the studio's navy and bone when they do not. */
.cmd {
  --cmd-ink: var(--chrome-ink, var(--bone));
  --cmd-ground: var(--chrome-ground, var(--navy));
  --cmd-rule: color-mix(in srgb, var(--cmd-ink) 28%, transparent);
  --cmd-hot: var(--head, var(--amber));
  position: relative; min-width: 0; margin-left: clamp(0.75rem, 2.2vw, 2rem); margin-right: auto;
  font-family: var(--mono, var(--sc-font-mono)); color: var(--cmd-ink);
}
.cmd__line {
  display: flex; align-items: center; gap: 0.6em; min-height: 2.25rem; max-width: 100%; padding: 0 0.75rem;
  border: 1px solid var(--cmd-rule); cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none;
  font-size: 0.72rem; letter-spacing: 0.06em; line-height: 1; white-space: nowrap;
}
.cmd__line::-webkit-details-marker { display: none; }
.cmd__line:focus-visible { outline: 2px solid var(--cmd-hot); outline-offset: 2px; }
.cmd__gt { color: var(--cmd-hot); font-weight: 500; }
.cmd__path { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cmd__path--s { display: none; }
.cmd__caret { flex: none; width: 0.5em; height: 1.05em; background: var(--cmd-hot); animation: cmd-blink 1.1s steps(1, end) infinite; }
.cmd[open] .cmd__line { border-color: var(--cmd-ink); }
.cmd[open] .cmd__caret { animation: none; opacity: 0.35; }
@keyframes cmd-blink { 50% { opacity: 0; } }
@media (hover: hover) and (pointer: fine) { .cmd__line:hover { border-color: var(--cmd-ink); } }

.cmd__panel {
  position: absolute; left: 0; top: calc(100% + 0.7rem); z-index: 5; width: min(27rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100vh - var(--bar-h) - 2rem); max-height: calc(100svh - var(--bar-h) - 2rem); overflow-y: auto; overscroll-behavior: contain;
  background: var(--cmd-ground); color: var(--cmd-ink); border: 1px solid var(--cmd-ink);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.55);
}
/* With cmd.js running the list eases in and out. The script holds the element open
   until the way out has finished; without the script it simply appears. */
.cmd.is-live .cmd__panel {
  opacity: 0; transform: translateY(-0.6rem); pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.cmd.is-live.is-in .cmd__panel {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity 240ms ease, transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) { .cmd.is-live .cmd__panel { transition: none; } }
.cmd__field { display: flex; align-items: center; gap: 0.6em; padding: 0 0.9rem; border-bottom: 1px solid var(--cmd-rule); font-size: 0.8rem; }
.cmd__field[hidden] { display: none; }
.cmd__field span { color: var(--cmd-hot); }
.cmd__field input {
  flex: 1; min-width: 0; height: 2.75rem; border: 0; outline: 0; background: none; color: inherit;
  font: inherit; letter-spacing: 0.04em; caret-color: var(--cmd-hot);
}
.cmd__field input::placeholder { color: inherit; opacity: 0.45; }
.cmd__list { list-style: none; margin: 0; padding: 0.35rem 0; }
.cmd__sep { margin: 0.35rem 0.9rem; border-top: 1px solid var(--cmd-rule); }
.cmd__list li[hidden] { display: none; }
.cmd__list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; min-height: 2.75rem; padding: 0.7rem 0.9rem;
  color: inherit; text-decoration: none; font-size: 0.8rem; letter-spacing: 0.04em; line-height: 1.2;
}
.cmd__list a b { font-weight: 500; white-space: nowrap; }
.cmd__list a b::before { content: "> "; color: var(--cmd-hot); opacity: 0; }
.cmd__list a i { font-style: normal; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; text-align: right; }
.cmd__list a.is-here b::after { content: "  \25A0"; color: var(--cmd-hot); font-size: 0.7em; }
.cmd__list a:focus-visible, .cmd__list a.is-pick { outline: 0; background: color-mix(in srgb, var(--cmd-ink) 12%, transparent); }
.cmd__list a:focus-visible b::before, .cmd__list a.is-pick b::before { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .cmd__list a:hover { background: color-mix(in srgb, var(--cmd-ink) 12%, transparent); }
  .cmd__list a:hover b::before { opacity: 1; }
}
.cmd__none { margin: 0; padding: 0.9rem; font-size: 0.75rem; letter-spacing: 0.04em; opacity: 0.6; }
.cmd__none[hidden] { display: none; }
.cmd__tools { display: none; }
.cmd__hint { margin: 0; padding: 0.6rem 0.9rem; border-top: 1px solid var(--cmd-rule); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.5; }

/* phones: the short form of the line, and the list as a sheet under the whole bar */
@media (max-width: 699px) {
  .cmd { position: static; margin-left: 0.6rem; margin-right: 0.6rem; }
  .bar__in { gap: 0; }
  .cmd__line { min-height: 2.5rem; padding: 0 0.5rem; gap: 0.45em; font-size: 0.68rem; letter-spacing: 0; }
  /* room for the line: a smaller wordmark and a tighter button */
  .bar .mark--primary { width: 5.25rem; }
  .bar .btn--sm { padding: 0 0.7rem; font-size: 0.8rem; }
  /* the sound switch moves into the sheet, where its label fits */
  .cmd__tools { display: block; padding: 0.75rem var(--gutter) 0.9rem; border-top: 1px solid var(--cmd-rule); }
  .cmd__tools:empty { display: none; }
  .cmd__tools .sound { width: 100%; justify-content: center; }
  .cmd__tools .sound__label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .cmd__path--l { display: none; }
  .cmd__path--s { display: block; }
  .cmd__panel { left: 0; right: 0; top: 100%; width: auto; border-width: 1px 0; }
  .cmd__list a { min-height: 3rem; padding-inline: var(--gutter); font-size: 0.85rem; }
  .cmd__sep { margin-inline: var(--gutter); }
  .cmd__hint { display: none; }
}
@media (hover: none) { .cmd__hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .cmd__caret { animation: none; } }
