/* The Portrait | Compatibility toggle (templates/_mode_toggle.html).

   One small segmented control, shared by the landing page and the compatibility sales
   page so the two products read as one site.  Its own stylesheet, not part of
   landing.css: the portrait landing page must stay byte-for-byte what it was apart from
   this control, and a separate file makes that checkable.

   The current side is filled with ink; the other side is a quiet link.  Sized for a
   thumb (36px tall) and set in the interface face, so it reads in Mongolian and English
   alike at 360px. */

.mode {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--canvas) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 7%, transparent);
  font: 600 .78rem/1 var(--sans);
}
.mode__opt {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 15px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none;
  transition: background .22s var(--ease, ease), color .22s var(--ease, ease);
}
.mode__opt:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.mode__opt[aria-current="page"], .mode__opt[aria-current="page"]:hover {
  background: var(--ink); color: #fff; cursor: default;
}
.mode__opt:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* On the landing page the control lives in the masthead, between the wordmark (left) and
   the language selector (right).  It is taken out of the flow so it is centred on the
   page whatever the widths of its neighbours are. */
.masthead .mode {
  position: absolute; z-index: 1; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
/* A phone has no room for all three on one line, so the control drops to a line of its
   own under the wordmark and the language selector, still centred. */
@media (max-width: 640px) {
  .masthead .mode { top: calc(100% - 4px); transform: translate(-50%, 0); }
  .mode__opt { padding: 0 13px; }
}
