/* The feature pages' kit (views/feature.templ, feature.js), as the old site had it (feature.css), on Daybook's tokens:
   what the bio link page shares with the feature pages after it. The heading over the phone with the business-name
   field, the phone (a black frame, Daybook's raised screen), the held stage and the counts under it, the design dock
   at the screen's foot with its menus of live miniatures and the note over it, and the phone's
   toast. Class names keep the bl- prefix of the bio link page, where it began. The studio's colour is a Daybook field
   (data-db-field on the phone, the dock and whatever else follows it). Inter Tight only; type in the phone keeps a
   15px floor; nothing inside a drawing moves. */

/* ---------------------------------------------------------------- the phone to try
   one column, top to bottom and centred: the heading, its words, the field, a
   hint, then the phone, held in view for a screen's worth of scroll with the counts under it; room at the foot for
   the dock */
.bl-try {
  padding: 40px var(--spacing-db-gutter) 160px;
}
.bl-try__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 58rem;
  margin: 0 auto 56px;
  text-align: center;
}
/* the heading at the homepage's size, on two lines */
.bl-try__title {
  max-width: 11em;
  margin: 0;
  font-size: calc(var(--db-size-display) * 0.8);
}
.bl-try__lead {
  max-width: 34em;
  margin: 0;
  text-wrap: balance;
}
.bl-try__hint {
  margin: 0;
  color: var(--db-fg-3);
  font: 400 0.9375rem/1.4 var(--font-db);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* the visitor's business: a field like a pill, its label inside */
.bl-name {
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: min(440px, 100%);
  height: 56px;
  margin-top: 4px;
  padding: 0 8px 0 22px;
  border-radius: var(--radius-db-full);
  background: var(--db-raised);
  box-shadow: 0 0 0 1px var(--db-edge-2), var(--shadow-db-float);
  cursor: text;
  transition: box-shadow var(--duration-db) var(--ease-db);
}
.bl-name:focus-within {
  box-shadow: 0 0 0 2px var(--db-fg), var(--shadow-db-float);
}
.bl-name__label {
  flex: none;
  color: var(--db-fg-3);
  font: 400 1rem/1 var(--font-db);
}
.bl-name__in {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--db-fg);
  font: 500 1.0625rem/1 var(--font-db);
  letter-spacing: -0.015em;
}
.bl-name__in::placeholder {
  color: var(--db-fg-3);
}

/* the held stage: the phone as tall as the screen leaves it under the bar and over the counts and the dock */
.bl-stage {
  --held-w: min(340px, calc(100vw - 48px), max(240px, calc((100svh - 310px) / 2.08)));
}
.bl-stage__stick {
  position: sticky;
  top: max(76px, calc(50svh - var(--held-w) * 1.04 - 90px));
  display: grid;
  justify-items: center;
  gap: 16px;
}
.bl-stage__run {
  height: 100svh;
}

/* ---------------------------------------------------------------- the phone: a black frame, the island, the screen */
.bl-ph {
  position: relative;
  box-sizing: border-box;
  width: var(--held-w);
  height: calc(var(--held-w) * 2.08);
  border: 10px solid var(--db-fg);
  border-radius: 50px;
  background: var(--db-fg);
  box-shadow: var(--shadow-db-float);
}
.bl-ph__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 40px;
  background: var(--db-raised);
  color: var(--db-fg);
  letter-spacing: -0.01em;
}
.bl-ph__screen::before {
  content: "";
  position: absolute;
  z-index: 6;
  top: 10px;
  left: 50%;
  width: min(80px, 30%);
  height: 24px;
  translate: -50% 0;
  border-radius: 20px;
  background: var(--db-fg);
}
.bl-ph__status {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  margin: 0;
  padding: 4px 20px 0 30px;
  font: 600 15px/1 var(--font-db);
}
.bl-ph__status svg {
  width: min(58px, 24%);
  height: 12px;
  fill: currentColor;
}
.bl-ph__app {
  position: relative;
  flex: 1;
  min-height: 0;
  container-type: inline-size;
}
.bl-icon {
  display: block;
  width: 20px;
  height: 20px;
}

/* a short line said at the foot of the screen */
.bl-toast {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 16px;
  left: 12px;
  margin: 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--db-inverse);
  color: var(--db-on-inverse);
  font: 400 15px/1.35 var(--font-db);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--duration-db) var(--ease-db), transform 0.4s var(--ease-db);
  pointer-events: none;
}
.bl-toast.is-on {
  opacity: 1;
  transform: none;
}
.bl-toast b {
  font-weight: 500;
}

/* a finger's tap, where the screen is pressed for the visitor */
.bl-tap {
  position: absolute;
  z-index: 5;
  top: var(--y, 50%);
  left: var(--x, 50%);
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--db-fg) 20%, transparent);
  box-shadow: 0 0 0 2px var(--db-raised);
  opacity: 0;
  transform: scale(1.3);
  transition: opacity 0.3s var(--ease-db), transform 0.4s var(--ease-db);
  pointer-events: none;
}
.bl-tap.is-on {
  opacity: 1;
  transform: none;
}
.bl-tap.is-press {
  transform: scale(0.8);
}

/* the counts under the phone; a count that goes up lifts in */
.bl-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 14px;
  margin: 0;
  color: var(--db-fg-3);
  font: 400 0.9375rem/1.4 var(--font-db);
  letter-spacing: -0.01em;
  text-align: center;
}
.bl-counts__k {
  width: 100%;
}
.bl-counts b {
  display: inline-block;
  color: var(--db-fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bl-counts b.is-up {
  animation: bl-up 0.5s var(--ease-db);
}
@keyframes bl-up {
  from {
    opacity: 0.3;
    transform: translateY(6px);
  }
}

/* ---------------------------------------------------------------- the dock
   a frosted bar at the screen's foot, in view while the phone is held; each button shows its group's choice and,
   pressed, opens the group's menu over the bar (a panel with a caret at the button). It rises in when the phone is
   held and sinks away when it moves on */
.bl-dock {
  position: fixed;
  z-index: 30;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 24px);
  opacity: 0;
  transform: translate(-50%, calc(100% + 40px));
  transition: transform 0.6s var(--ease-db), opacity var(--duration-db) var(--ease-db);
  pointer-events: none;
}
.bl-dock.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* the note over the dock until it is first pressed (not while a menu is open): one line, nudging at the dock */
.bl-coach {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--db-inverse);
  color: var(--db-on-inverse);
  font: 500 0.9375rem/1.35 var(--font-db);
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: var(--shadow-db-float);
  opacity: 0;
  translate: -50% 8px;
  transition: opacity var(--duration-db) var(--ease-db), translate 0.45s var(--ease-db);
  pointer-events: none;
}
.bl-coach::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: inherit;
  transform: rotate(45deg);
}
.bl-dock.is-shown.is-coach:not(.is-open) .bl-coach {
  opacity: 1;
  translate: -50% 0;
  transition-delay: 0.45s;
}

.bl-tools {
  display: flex;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius-db-full);
  background: color-mix(in srgb, var(--db-raised) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-db-float), 0 0 0 1px var(--db-edge);
}
.bl-tt {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 8px;
  border: 0;
  border-radius: var(--radius-db-full);
  background: transparent;
  color: var(--db-fg);
  cursor: pointer;
  font: 500 0.9375rem/1 var(--font-db);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color var(--duration-db-fast) var(--ease-db), color var(--duration-db-fast) var(--ease-db);
}
.bl-tt:hover {
  background: var(--db-hover);
}
.bl-tt:focus-visible,
.bl-opt:focus-visible {
  outline: 2px solid var(--db-focus);
  outline-offset: 2px;
}
.bl-tt[aria-expanded="true"] {
  background: var(--db-selected);
  color: var(--db-on-selected);
}
.bl-tt__pv {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

/* the buttons' previews: a theme's small page, the colour's swatch, the type's sample */
.bl-th {
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  width: 20px;
  height: 25px;
  padding: 3px;
  border-radius: 4px;
  background: var(--db-card);
  box-shadow: inset 0 0 0 1px var(--db-edge-2);
}
.bl-th i {
  display: block;
  border-radius: 1px;
  background: var(--db-fg);
}
.bl-th i:first-child {
  flex: 1;
  background: var(--db-field);
}
.bl-th i:nth-child(2) {
  width: 80%;
  height: 2px;
}
.bl-th i:nth-child(3) {
  width: 55%;
  height: 2px;
  opacity: 0.5;
}
.bl-th[data-th="editorial"] {
  background: var(--db-bg);
}
.bl-th[data-th="editorial"] i:first-child {
  background: var(--db-fg-3);
}
.bl-th[data-th="bold"] {
  background: var(--db-field);
}
.bl-th[data-th="bold"] i {
  background: var(--db-field-ink);
}
.bl-th[data-th="bold"] i:first-child {
  opacity: 0.4;
}
.bl-th[data-th="pastel"] {
  background: var(--db-bg);
}
.bl-th[data-th="pastel"] i:first-child {
  border-radius: 3px;
  background: var(--db-field-soft);
}
.bl-th[data-th="dark"] {
  background: var(--db-inverse);
}
.bl-th[data-th="dark"] i {
  background: var(--db-on-inverse);
}
.bl-th[data-th="dark"] i:first-child {
  background: var(--db-field);
}
.bl-sw {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--db-field);
  box-shadow: inset 0 0 0 1px var(--db-edge-2);
}
.bl-aa {
  font: 500 16px/1 var(--font-db);
  letter-spacing: -0.02em;
}
.bl-aa[data-aa="light"] {
  font-size: 19px;
  font-weight: 300;
  letter-spacing: -0.04em;
}
.bl-aa[data-aa="poster"] {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

/* the menu over the bar: it opens from its button (growing from the caret), its options fade in with it */
.bl-menus {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 14px;
  border-radius: 24px;
  background: var(--db-raised);
  box-shadow: var(--shadow-db-float), 0 0 0 1px var(--db-edge);
  opacity: 0;
  visibility: hidden;
  translate: -50% 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: var(--caret, 50%) 100%;
  transition: opacity 0.2s var(--ease-db), transform 0.4s var(--ease-db), visibility 0s 0.4s;
  pointer-events: none;
}
.bl-dock.is-open .bl-menus {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
  pointer-events: auto;
}
.bl-menus__caret {
  position: absolute;
  bottom: -6px;
  left: var(--caret, 50%);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--db-raised);
  box-shadow: 1px 1px 0 var(--db-edge);
  transform: rotate(45deg);
  transition: left var(--duration-db) var(--ease-db);
}
.bl-menu {
  display: none;
}
.bl-menu.is-on {
  display: block;
  animation: bl-menu-in var(--duration-db) var(--ease-db);
}
@keyframes bl-menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.bl-menu__title {
  margin: 2px 4px 10px;
  color: var(--db-fg-3);
  font: 400 0.9375rem/1.3 var(--font-db);
  letter-spacing: -0.01em;
}
.bl-menu__opts {
  display: flex;
  gap: 6px;
}
/* an option: its live miniature (or its sample), its name under it; the choice ringed in ink, the one looked at in
   the muted edge, neither moving */
.bl-opt {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-width: 88px;
  padding: 8px 6px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--db-fg-3);
  cursor: pointer;
  font: 400 0.9375rem/1.2 var(--font-db);
  letter-spacing: -0.01em;
  text-align: center;
  transition: background-color var(--duration-db-fast) var(--ease-db), color var(--duration-db-fast) var(--ease-db);
}
.bl-opt:is(:hover, .is-look) {
  background: var(--db-card);
  color: var(--db-fg);
}
.bl-opt[aria-pressed="true"] {
  color: var(--db-fg);
  font-weight: 500;
}
.bl-opt__name {
  white-space: nowrap;
}
.bl-pv {
  display: grid;
  place-items: center;
}
/* a live miniature: the page drawn at 300px wide, a fifth its size, in a small black-framed phone */
.bl-mini {
  display: block;
  box-sizing: border-box;
  width: 66px;
  height: 128px;
  overflow: hidden;
  border: 3px solid var(--db-fg);
  border-radius: 13px;
  background: var(--db-raised);
  transition: box-shadow var(--duration-db) var(--ease-db);
}
.bl-mini__screen {
  display: block;
  width: 300px;
  height: 610px;
  transform: scale(0.2);
  transform-origin: 0 0;
  pointer-events: none;
}
.bl-mini .bl-lp {
  min-height: 610px;
  transition: none;
}
.bl-opt[aria-pressed="true"] .bl-mini {
  box-shadow: 0 0 0 2px var(--db-raised), 0 0 0 4px var(--db-fg);
}
.bl-opt.is-look:not([aria-pressed="true"]) .bl-mini {
  box-shadow: 0 0 0 2px var(--db-raised), 0 0 0 4px var(--db-card-3);
}
/* a menu's line under its options: what the option shown is for; as wide as the options, so it never moves them */
.bl-menu__note {
  width: 0;
  min-width: 100%;
  margin: 10px 0 0;
  padding: 0 4px;
  box-sizing: border-box;
  color: var(--db-fg-3);
  font: 400 0.9375rem/1.4 var(--font-db);
  letter-spacing: -0.01em;
}
.bl-menu__say {
  min-height: 2.8em;
}
.bl-menu__say b {
  margin-right: 0.35em;
  color: var(--db-fg);
  font-weight: 500;
}

/* Show: a list of details, each with its switch */
.bl-menu[data-menu="show"] .bl-menu__opts {
  flex-direction: column;
  gap: 2px;
  min-width: 300px;
}
.bl-opt--show {
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  color: var(--db-fg);
  text-align: left;
}
.bl-opt--show[aria-pressed="true"] {
  font-weight: 400;
}
.bl-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin-left: auto;
  border-radius: var(--radius-db-full);
  background: var(--db-card-3);
  transition: background-color var(--duration-db) var(--ease-db);
}
.bl-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--db-raised);
  box-shadow: 0 1px 3px var(--db-edge-3);
  transition: transform var(--duration-db) var(--ease-db);
}
.bl-opt--show[aria-pressed="true"] .bl-switch {
  background: var(--db-fg);
}
.bl-opt--show[aria-pressed="true"] .bl-switch::after {
  transform: translateX(16px);
}

/* a link to copy: its address, then Copy */
.bl-share__link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-db-full);
  background: var(--db-card);
}
.bl-share__url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 500 0.9375rem/1.2 var(--font-db);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* a narrower screen: the bar's buttons are their previews alone */
@media (max-width: 1099px) {
  .bl-tt {
    gap: 0;
    padding: 0 8px;
  }
  .bl-tt__name {
    display: none;
  }
}
/* a phone: the heading tighter, the dock's buttons smaller; a menu spans the screen, its options a row that scrolls */
@media (max-width: 767px) {
  .bl-try {
    padding-top: 24px;
  }
  .bl-try__head {
    margin-bottom: 40px;
  }
  .bl-stage {
    --held-w: min(340px, calc(100vw - 48px), max(236px, calc((100svh - 300px) / 2.08)));
  }
  .bl-dock {
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .bl-tools {
    gap: 0;
    padding: 4px;
  }
  .bl-tt {
    height: 40px;
    padding: 0 6px;
  }
  .bl-menus {
    width: calc(100vw - 24px);
    padding: 12px 12px 14px;
  }
  .bl-menu__opts {
    margin-inline: -12px;
    padding: 4px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .bl-menu__opts::-webkit-scrollbar {
    display: none;
  }
  .bl-opt {
    min-width: 80px;
  }
  .bl-menu[data-menu="show"] .bl-menu__opts {
    min-width: 0;
    margin-inline: 0;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-toast,
  .bl-tap,
  .bl-dock,
  .bl-coach,
  .bl-menus,
  .bl-menus__caret,
  .bl-opt,
  .bl-switch,
  .bl-switch::after {
    transition: none !important;
  }
  .bl-menu.is-on,
  .bl-counts b.is-up {
    animation: none !important;
  }
}
