/* The Treasure Chest's chip in the header (components/chest-chip.js): the
   chest icon and the balance in small mono caps inside a hairline pill, the
   theme toggle's dress, in the header's own color (so white over a full hero),
   a dot in the accent while a deposit waits unopened. Hidden until <html>
   carries `has-chest` (the head script, or the chip's script). It holds still
   across pages under its own view-transition-name, as the account slot does.
   On the narrowest phones the lockup drops to the mark alone while the chip is
   there, so the header keeps one row (Costa, 2026-11-11). */

.chest-chip {
  view-transition-name: chest-chip;
  display: none;
  align-items: center;
  gap: 0.4rem;
  height: 2rem;
  padding: 0 0.7rem;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: var(--pill);
  color: inherit;
  font-family: var(--mono);
  font-size: var(--tiny);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: border-color var(--fast), color var(--fast);
}
:root.has-chest .chest-chip { display: inline-flex; }
.chest-chip:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); }
.chest-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chest-chip svg { flex: none; }
/* The amount holds the width of the balance it counts to from first paint
   (--chars, its length, set by the component's inline script and the chip's
   script): a mono face, so every character is 1ch plus the tracking, and the
   count from $0 never moves the header (Costa, 2026-11-15) */
.chest-chip [data-chest-amount] { min-width: calc(var(--chars, 0) * (1ch + 0.04em)); }
.chest-chip.unseen::after { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.has-full-hero .site-header:not(.scrolled) .chest-chip.unseen::after { background: var(--white); }

@media (max-width: 440px) {
  :root.has-chest .lockup-text { display: none; }
}
