/* Quantum Cookies banner: a slim pill at the bottom of the screen, in the page's reverse colors
   (like the menu): dark on the light page, light on the dark one. Uses the theme's tokens when they
   exist (coming soon page), with dark fallbacks for any other theme. */

.qck-banner {
    --qck-bg: var(--cs-nav-bg, #262a30);
    --qck-text: var(--cs-nav-text, #c3cad4);
    --qck-strong: var(--cs-bg, #ffffff); /* the page's own background: always contrasts with the bar */
    --qck-line: color-mix(in srgb, var(--qck-text) 45%, var(--qck-bg));
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 8px 8px 8px 20px;
    font-family: Manrope, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    color: var(--qck-text);
    background: var(--qck-bg);
    border: 1px solid var(--qck-line);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(20, 24, 30, 0.28);
    transition: background-color 0.6s ease, color 0.6s ease;
    transform: translateX(-50%);
}

.qck-banner[hidden] {
    display: none;
}

.qck-banner.is-open {
    animation: qck-in 0.35s ease-out;
}

@keyframes qck-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.qck-text {
    margin: 0;
    font-weight: 400;
}

/* Explicit weight: "bolder" from a light page weight would barely change */
.qck-text b,
.qck-text strong {
    font-weight: 800;
    color: var(--qck-strong);
}

.qck-actions {
    display: flex;
    flex: none;
    gap: 6px;
}

/* Same size and weight: saying no is as easy as saying yes */
.qck-button {
    min-width: 128px;
    height: 38px;
    padding: 0 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.qck-button--deny {
    color: var(--qck-strong);
    background: transparent;
    border: 1.5px solid var(--qck-line);
}

.qck-button--deny:hover {
    border-color: var(--qck-strong);
}

.qck-button--accept {
    color: var(--cs-accent-text, #262a30);
    background: var(--cs-accent, #f0c24b);
    border: 1.5px solid var(--cs-accent, #f0c24b);
}

.qck-button--accept:hover {
    background: var(--cs-accent-hover, #d99b2b);
    border-color: var(--cs-accent-hover, #d99b2b);
}

.qck-button:focus-visible,
.qck-open:focus-visible {
    outline: 2px solid var(--cs-accent, #f0c24b);
    outline-offset: 2px;
}

/* The "Cookie choices" link that reopens the banner */
.qck-open {
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    cursor: pointer;
}

@media (max-width: 640px) {
    .qck-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: calc(100% - 24px);
        padding: 14px;
        text-align: center;
        border-radius: 18px;
    }

    .qck-button {
        flex: 1;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qck-banner.is-open {
        animation: none;
    }
}

/* ---- Emphasis (assets/js/emphasis.js): the text is split into .qck-word > .qck-char spans ---- */

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

.qck-word {
    display: inline-block;
    white-space: nowrap;
}

.qck-char {
    display: inline-block;
    transform: scale(var(--qck-scale, 1));
    transform-origin: 50% 70%;
}

.qck-text {
    transition: font-size 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* 1. Wave: each letter grows to 1.5x in turn */
.qck-wave .qck-char {
    animation: qck-wave 0.45s ease-in-out both;
    animation-delay: calc(var(--qck-i) * 30ms);
}

@keyframes qck-wave {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.5) translateY(-2px); }
}

/* 2. Rainbow: bigger text with an outline, a rainbow running through the letters */
.qck-big {
    font-size: 1.5em;
}

.qck-outline .qck-char {
    -webkit-text-stroke: 1.5px var(--qck-strong);
    paint-order: stroke fill;
    transition: -webkit-text-stroke-color 0.3s ease;
}

.qck-rainbow .qck-char {
    animation: qck-rainbow 0.9s linear infinite;
    animation-delay: calc(var(--qck-i) * -40ms); /* each letter a little further along: the colors travel */
}

@keyframes qck-rainbow {
    0% { color: #ff4d4d; }
    17% { color: #ff9f1a; }
    33% { color: #ffe14d; }
    50% { color: #4dd97a; }
    67% { color: #4dafff; }
    83% { color: #a970ff; }
    100% { color: #ff4d4d; }
}

/* 3. Party: random sizes and colors (set by the script every 450ms), plus confetti */
.qck-party .qck-char {
    color: var(--qck-color, inherit);
    transition: transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1), color 0.4s ease;
}

.qck-confetti {
    position: fixed;
    inset: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---- The list of categories: slides open above the pill from the yes button ---- */

.qck-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    box-sizing: border-box;
    width: min(400px, calc(100vw - 24px));
    padding: 18px;
    text-align: left;
    color: var(--qck-text);
    background: var(--qck-bg);
    border: 1px solid var(--qck-line);
    max-height: calc(100vh - 140px); /* scrolls on short screens */
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(20, 24, 30, 0.28);
    opacity: 0;
    visibility: hidden; /* also out of the tab order while closed */
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2), visibility 0s linear 0.3s;
}

.qck-banner.is-choosing .qck-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}

.qck-panel__title {
    margin: 0 0 10px;
    font-weight: 800;
    color: var(--qck-strong);
}

.qck-choices {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.qck-choice + .qck-choice {
    border-top: 1px solid var(--qck-line);
}

.qck-choice__row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    cursor: pointer;
}

.qck-choice__text {
    flex: 1;
    min-width: 0;
}

.qck-choice__label {
    display: block;
    font-weight: 700;
    color: var(--qck-strong);
}

.qck-choice__desc,
.qck-choice__cookies {
    display: block;
    font-size: 13px;
    line-height: 1.4;
}

.qck-choice__cookies {
    margin: -4px 56px 10px 0;
    overflow-wrap: anywhere;
}

.qck-choice__cookies summary {
    width: max-content;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.qck-choice__cookies summary:focus-visible {
    outline: 2px solid var(--cs-accent, #f0c24b);
    outline-offset: 2px;
}

/* Switch: a checkbox drawn as a track and knob */
.qck-switch {
    flex: none;
    position: relative;
    width: 42px;
    height: 24px;
    margin: 0;
    appearance: none;
    background: transparent;
    border: 1.5px solid var(--qck-line);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.qck-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    background: var(--qck-text);
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.qck-switch:checked {
    background: var(--cs-accent, #f0c24b);
    border-color: var(--cs-accent, #f0c24b);
}

.qck-switch:checked::after {
    background: var(--cs-accent-text, #262a30);
    transform: translateX(18px);
}

.qck-switch:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.qck-choice__row:has(.qck-switch:disabled) {
    cursor: default;
}

.qck-switch:focus-visible {
    outline: 2px solid var(--cs-accent, #f0c24b);
    outline-offset: 2px;
}

.qck-save {
    width: 100%;
}

@media (max-width: 640px) {
    .qck-panel {
        left: 0;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qck-panel,
    .qck-switch,
    .qck-switch::after {
        transition: none;
    }
}
