/* Incremental UI-kit foundation. Only .bth-ui surfaces opt in. */
@font-face {
    font-family: "Bth DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/bedtimeheroes/dm-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Bth DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/bedtimeheroes/dm-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Bth Fraunces";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/bedtimeheroes/fraunces-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Bth Fraunces";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/bedtimeheroes/fraunces-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.bth-ui {
    --bth-paper: #262331;
    --bth-paper-deep: #302b3b;
    --bth-surface: #322d3d;
    --bth-surface-soft: #3b3446;
    --bth-ink: #f5eddf;
    --bth-muted: #c3b8c9;
    --bth-plum: #d5bde1;
    --bth-plum-hover: #e7d2ee;
    --bth-plum-soft: #45374f;
    --bth-clay: #f0b095;
    --bth-clay-soft: #503b38;
    --bth-leaf: #bacdb1;
    --bth-leaf-soft: #374238;
    --bth-line: #51475b;
    --bth-line-strong: #8d7f96;
    --bth-on-plum: #302536;
    --bth-danger: #ffb3a7;
    --bth-focus: #e2c4ed;
    --bth-font-body: "Bth DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bth-font-display: "Bth Fraunces", Georgia, serif;
    color: var(--bth-ink);
    color-scheme: dark;
    font: 400 16px / 1.6 var(--bth-font-body);
    font-optical-sizing: auto;
}

/* Keep the app's existing preference IDs; all three are evening palettes. */
[data-theme="sunset"] .bth-ui,
.bth-ui[data-theme="sunset"] {
    --bth-paper: #2d252b;
    --bth-paper-deep: #372c32;
    --bth-surface: #3b3035;
    --bth-surface-soft: #45363d;
    --bth-plum: #edc1b0;
    --bth-plum-hover: #f5d4c7;
    --bth-plum-soft: #513c40;
    --bth-line: #59474e;
    --bth-line-strong: #997e85;
    --bth-on-plum: #39272e;
    --bth-focus: #f5d4c7;
}

[data-theme="stardust"] .bth-ui,
.bth-ui[data-theme="stardust"] {
    --bth-paper: #282436;
    --bth-paper-deep: #302b40;
    --bth-surface: #342f44;
    --bth-surface-soft: #3d3650;
    --bth-plum: #cec2ed;
    --bth-plum-hover: #e4d8f7;
    --bth-plum-soft: #433953;
    --bth-line: #514861;
    --bth-line-strong: #8d809e;
    --bth-focus: #e4d8f7;
}

.bth-ui,
.bth-ui *,
.bth-ui *::before,
.bth-ui *::after {
    box-sizing: border-box;
}

.bth-ui :where(button, input, select, textarea) {
    font: inherit;
}

.bth-ui :where(h1, h2, h3, h4, h5, h6) {
    color: var(--bth-ink);
    font-family: var(--bth-font-display);
    font-weight: 550;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.bth-ui:focus-visible,
.bth-ui :focus-visible {
    outline: 3px solid var(--bth-focus);
    outline-offset: 3px;
}

.bth-ui[tabindex="-1"]:focus,
.bth-ui [tabindex="-1"]:focus {
    outline: none;
}

.bth-ui .bth-button,
.bth-ui .bth-button-secondary,
.bth-ui .bth-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    font-family: var(--bth-font-body);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.bth-ui .bth-button {
    background: var(--bth-plum);
    color: var(--bth-on-plum);
}

.bth-ui .bth-button-secondary,
.bth-ui .bth-icon-button {
    border-color: var(--bth-line-strong);
    background: var(--bth-surface);
    color: var(--bth-ink);
}

.bth-ui .bth-icon-button {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 12px;
}

.bth-ui :is(.bth-button, .bth-button-secondary, .bth-icon-button):disabled,
.bth-ui :is(.bth-button, .bth-button-secondary, .bth-icon-button)[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

.bth-ui .bth-eyebrow {
    color: var(--bth-muted);
    font-family: var(--bth-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
}

.bth-ui .bth-muted {
    color: var(--bth-muted);
}

.bth-ui .bth-surface {
    border: 1px solid var(--bth-line);
    border-radius: 22px;
    background: var(--bth-surface);
    color: var(--bth-ink);
}

@media (hover: hover) {
    .bth-ui .bth-button:hover:not(:disabled):not([aria-disabled="true"]) {
        background: var(--bth-plum-hover);
    }

    .bth-ui :is(.bth-button-secondary, .bth-icon-button):hover:not(:disabled):not([aria-disabled="true"]) {
        background: var(--bth-surface-soft);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bth-ui :is(.bth-button, .bth-button-secondary, .bth-icon-button) {
        transition: none;
    }
}
