.email {
    display: inline-block;
    width: max-content;
    max-width: 100%;
    padding: 12px 18px;
    border: 1px solid #303a40;
    border-radius: 16px;
    background: linear-gradient(180deg, #303a40, #222b31);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 3px 7px rgba(25, 32, 37, 0.12);
    color: #faf8f4;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: nowrap;
}

.email:has(a) {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.email a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid #303a40;
    border-radius: inherit;
    background: linear-gradient(180deg, #303a40, #222b31);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 3px 7px rgba(25, 32, 37, 0.12);
    color: #faf8f4;
    text-decoration: none;
    transition: box-shadow 160ms ease, border-color 160ms ease;
}

.email a::before {
    content: "";
    flex: 0 0 18px;
    width: 18px; /* WebKit needs an explicit width when sizing the button. */
    height: 18px;
    background: #d8bd86;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (hover: hover) {
    .email a:hover {
        border-color: #9c8356;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
            0 4px 10px rgba(25, 32, 37, 0.18);
    }
}

.email a:active {
    background: #20282d;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.email a:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 4px;
}

.email[hidden] {
    display: none;
}

.email.loading {
    opacity: 0.55;
}

@media (prefers-color-scheme: dark) {
    .email:not(:has(a)), .email a {
        border-color: #50595e;
        background: linear-gradient(180deg, #3b454c, #303a40);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
            0 3px 7px rgba(0, 0, 0, 0.18);
    }

    .email a:active {
        background: #293239;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .email a {
        transition: none;
    }
}

@media (prefers-contrast: more) {
    .email, .email a {
        border: 1px solid currentColor;
    }
}

@media (max-width: 360px) {
    .email {
        font-size: 0.875rem;
        padding: 12px;
    }

    .email:has(a) {
        padding: 0;
    }

    .email a {
        gap: 8px;
        padding: 12px;
    }

    .email .sep-glyph {
        margin-inline: 0.22em;
    }
}
