/* Wordmark "Depotblick" (assets/wordmark.js): "blick" stands still, the prefix rolls through the other -blick words.
   Set like the app's specimen figure: the rolling prefix in full weight, the constant "blick" light and muted, the way
   the app sets the cents of its hero amount. Self-contained so it can move into the app; only --figure, --muted and
   --font-figure come from outside.

   The prefix rolls the way the app re-sets a figure (RollingFigure in app.css): only the letters that change move,
   each rolling one place up, left to right 30ms apart; a letter that stays, like the "D" of "Durch" and "Depot",
   stands still. The prefix starts at the wordmark's left edge, so the edge never moves: each letter's place opens or
   closes to the width of its new letter, and "blick" glides along with them. */

.wordmark {
    width: fit-content;
    margin: 0;
    font-family: var(--font-figure, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif);
    font-size: clamp(56px, 7.2vw, 104px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.035em;
    white-space: nowrap;
    /* Selecting mid-roll would copy the leaving letters too. */
    user-select: none;
}

.wordmark-prefix {
    display: inline-block;
    color: var(--figure);
    /* The line box holds the descender of "p"; the sides stay open for glyph overhang. */
    clip-path: inset(0 -0.1em);
}

/* A letter's place, from the prefix's first roll on. Its width is the letter's advance within the word, kerning
   included (measured by the script), so a word set in its places stands where the plain text does. */
.wordmark-slot {
    display: inline-block;
    position: relative;
    white-space: pre;
    vertical-align: top;
    transition: width 360ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.wordmark-new,
.wordmark-old {
    display: inline-block;
    animation: 420ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
    animation-delay: inherit;
}

.wordmark-old {
    position: absolute;
    top: 0;
    left: 0;
}

.wordmark-new {
    animation-name: wordmark-in;
}

.wordmark-old {
    animation-name: wordmark-out;
}

/* A fifth beyond the line box: the descender of "p" reaches below it and would otherwise show as a dot. The leaving
   letter rides that far ahead of the arriving one, like the next figure on a counter wheel. */
@keyframes wordmark-in {
    from {
        transform: translateY(120%);
    }
}

@keyframes wordmark-out {
    to {
        transform: translateY(-120%);
        opacity: 0;
    }
}

.wordmark-blick {
    color: var(--muted);
    font-weight: 300;
    letter-spacing: -0.02em;
}
