/* ==========================================================================
   Components. Each block is self-contained and driven only by tokens.
   ========================================================================== */

/* ---------- icon ----------
   Icons live as single files in assets/icons/ and are painted through a mask,
   so one file serves every colour it is ever needed in. */

.icon {
    display: inline-block;
    flex: none;
    width: 1.1em;
    height: 1.1em;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.icon--telegram { --icon: url(../assets/icons/telegram.svg); }
.icon--mail { --icon: url(../assets/icons/mail.svg); }

/* ---------- button ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-weight: var(--weight-semibold);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color var(--duration-fast) var(--ease-out),
        background-color var(--duration-fast) var(--ease-out),
        transform var(--duration-fast) var(--ease-out);
}

.button:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-text-inverse);
    box-shadow:
        0 1px 0 rgb(255 255 255 / 0.35) inset,
        0 8px 22px -10px rgb(252 58 114 / 0.95);
}

.button--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.button--primary:active {
    background: var(--color-accent-active);
}

/* Ink counterpart to the pink button. Two solid buttons read as a pair and
   carry far more weight in the header than an outlined one on white. */
.button--dark {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: var(--color-text-inverse);
    box-shadow: 0 6px 18px -10px rgb(4 4 7 / 0.8);
}

.button--dark:hover,
.button--dark:focus-visible {
    background: var(--ink-800);
    border-color: var(--ink-800);
}

.button--compact {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
}

/* The short label only exists for narrow screens; the full one stays in the
   accessibility tree so the button never announces itself as just "Bot". */
.button__short {
    display: none;
}

@media (max-width: 34rem) {
    .button--compact {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }

    .button--compact .button__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .button--compact .button__short {
        display: inline;
    }

    .button--compact .icon {
        width: 1rem;
        height: 1rem;
    }
}
