/* ==========================================================================
   shell.css - site-wide skin: floating header, footer, and a restyle of the
   Bootstrap patterns the inner pages are built from (hero, cards, buttons,
   forms). Loaded on every page from base.html, independent of the
   main.css / main.min.css build step.
   ========================================================================== */

:root {
    --sh-ink: #0a0f1f;
    --sh-ink-2: #111931;
    --sh-line: rgba(148, 163, 184, .18);
    --sh-accent: #6366f1;
    --sh-accent-soft: #818cf8;
    --sh-dim: #94a3b8;
    --sh-page: #f6f7fc;
    --sh-border: #e6e9f2;
    --sh-radius: 14px;
    --sh-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* A sticky header would otherwise cover whatever a #fragment scrolls to. */
:target {
    scroll-margin-top: 6.5rem;
}

body {
    background: var(--sh-page);
}

/* ============================================================ floating header */

.sh-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: .85rem 0;
    pointer-events: none;
}

.sh-bar {
    pointer-events: auto;
}

/* The bar itself is the surface - the strip around it stays transparent so the
   page scrolls past behind it. */
.sh-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .55rem .6rem .55rem 1rem;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    background: rgba(12, 17, 34, .9);
    backdrop-filter: saturate(170%) blur(14px);
    -webkit-backdrop-filter: saturate(170%) blur(14px);
    box-shadow: 0 10px 34px -16px rgba(2, 6, 23, .85),
                inset 0 1px 0 rgba(255, 255, 255, .06);
}

@supports not (backdrop-filter: blur(10px)) {
    .sh-bar {
        background: #0c1122;
    }
}

.sh-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: #fff;
    flex: none;
}

.sh-brand:hover {
    color: #fff;
}

.sh-collapse {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-left: auto;
}

.sh-logo {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(145deg, #6366f1, #7c3aed 60%, #a855f7);
    box-shadow: 0 6px 16px -8px rgba(99, 102, 241, .95);
    flex: none;
}

.sh-logo img {
    width: 22px;
    height: 22px;
}

.sh-brand-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.15;
}

.sh-brand-tag {
    display: block;
    font-family: var(--sh-mono);
    font-size: .6rem;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--sh-dim);
    line-height: 1.15;
}

/* nav links sit in their own inset group */
.sh-nav {
    display: flex;
    align-items: center;
    gap: .1rem;
    list-style: none;
    margin: 0;
    padding: .2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
}

.sh-nav a {
    display: block;
    padding: .42rem .95rem;
    border-radius: 999px;
    color: #cbd5e1;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}

.sh-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.sh-nav a.active {
    color: #fff;
    background: linear-gradient(180deg, rgba(129, 140, 248, .3), rgba(99, 102, 241, .22));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .25);
}

.sh-cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: none;
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    border: 1px solid #4338ca;
    color: #fff !important;
    font-size: .88rem;
    font-weight: 600;
    border-radius: 999px;
    padding: .5rem 1.05rem;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 8px 20px -12px rgba(79, 70, 229, 1);
}

.sh-cta:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 13px 26px -12px rgba(79, 70, 229, 1);
}

.sh-burger {
    display: none;
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid rgba(148, 163, 184, .25);
    background: rgba(255, 255, 255, .04);
    color: #e2e8f5;
    font-size: 1rem;
    cursor: pointer;
}

.sh-burger:focus-visible {
    outline: 2px solid var(--sh-accent-soft);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .sh-bar {
        flex-wrap: wrap;
        border-radius: 18px;
        padding: .6rem .7rem;
    }

    .sh-burger {
        display: block;
    }

    .sh-collapse {
        flex-basis: 100%;
        display: none;
    }

    .sh-collapse.open {
        display: block;
    }

    .sh-nav {
        flex-direction: column;
        align-items: stretch;
        gap: .15rem;
        margin: .6rem 0 .5rem;
        border-radius: 14px;
    }

    .sh-nav a {
        border-radius: 10px;
    }

    .sh-cta {
        display: flex;
        justify-content: center;
        border-radius: 12px;
    }

    .sh-brand-tag {
        display: none;
    }
}

/* ================================================================ page heroes */

/* Inner pages (donate, contact) use .hero-gradient from main.css. Replace the
   flat purple with the same dark surface the homepage hero uses. */
.hero-gradient,
.cta-gradient {
    position: relative;
    background:
        radial-gradient(820px 380px at 15% -20%, rgba(129, 140, 248, .26), transparent 62%),
        radial-gradient(620px 340px at 85% -10%, rgba(167, 139, 250, .18), transparent 64%),
        var(--sh-ink) !important;
    border-bottom: 1px solid var(--sh-line);
    overflow: hidden;
}

.hero-gradient::before,
.cta-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--sh-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--sh-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(700px 320px at 35% 0%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(700px 320px at 35% 0%, #000 0%, transparent 72%);
    opacity: .45;
    pointer-events: none;
}

.hero-gradient > *,
.cta-gradient > * {
    position: relative;
    z-index: 1;
}

.hero-gradient .lead,
.cta-gradient .lead {
    color: #cbd5e1;
}

/* Page titles */
.display-3,
.display-4 {
    font-weight: 800;
    letter-spacing: -.03em;
}

/* A bare page title with no hero behind it still needs to breathe under the
   floating header. */
main > .container:first-child,
main > div > .container:first-child {
    padding-top: 1rem;
}

/* ====================================================================== cards */

.card {
    border: 1px solid var(--sh-border) !important;
    border-radius: var(--sh-radius) !important;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.card.shadow-sm,
.card.shadow {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
}

.card.shadow-sm:hover,
.card.shadow:hover {
    border-color: #c7cdf5 !important;
    box-shadow: 0 16px 36px -24px rgba(49, 46, 129, .5) !important;
}

.card.bg-light {
    background: #fafbff !important;
}

.card-title {
    letter-spacing: -.01em;
}

/* ==================================================================== buttons */

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-lg {
    border-radius: 12px;
    padding: .7rem 1.35rem;
}

.btn-primary {
    --bs-btn-bg: #4f46e5;
    --bs-btn-border-color: #4338ca;
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #3730a3;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #312e81;
    --bs-btn-disabled-bg: #6366f1;
    --bs-btn-disabled-border-color: #6366f1;
    background-image: linear-gradient(180deg, #6366f1, #4f46e5);
    box-shadow: 0 8px 22px -12px rgba(79, 70, 229, .95);
}

.btn-primary:hover {
    background-image: linear-gradient(180deg, #5b5ef0, #4338ca);
}

.btn-outline-primary {
    --bs-btn-color: #4f46e5;
    --bs-btn-border-color: #c7cdf5;
    --bs-btn-hover-bg: #4f46e5;
    --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #4338ca;
}

.hero-gradient .btn-light,
.cta-gradient .btn-light {
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #ffffff;
    font-weight: 600;
}

.hero-gradient .btn-outline-light,
.cta-gradient .btn-outline-light {
    --bs-btn-border-color: rgba(226, 232, 240, .28);
    --bs-btn-color: #e2e8f5;
    --bs-btn-hover-bg: rgba(226, 232, 240, .1);
    --bs-btn-hover-border-color: rgba(226, 232, 240, .5);
    --bs-btn-hover-color: #ffffff;
}

/* The API-key page builds its tier picker and submit button from btn-dark /
   btn-outline-dark. Bring both into the indigo palette. */
.btn-dark {
    --bs-btn-bg: #1b2238;
    --bs-btn-border-color: #1b2238;
    --bs-btn-hover-bg: #222b45;
    --bs-btn-hover-border-color: #222b45;
    --bs-btn-active-bg: #151b2e;
}

.btn-outline-dark {
    --bs-btn-color: #1e293b;
    --bs-btn-border-color: #dfe3ef;
    --bs-btn-hover-bg: #f3f4fb;
    --bs-btn-hover-border-color: #c7cdf5;
    --bs-btn-hover-color: #1e293b;
}

.btn-check:checked + .btn-outline-dark {
    background-color: #4f46e5 !important;
    border-color: #4338ca !important;
    box-shadow: 0 10px 26px -16px rgba(79, 70, 229, 1);
}

.btn-check:focus-visible + .btn-outline-dark {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

/* ====================================================================== forms */

.form-label {
    font-size: .88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: .4rem;
}

.form-control,
.form-select {
    border: 1px solid #dfe3ef;
    border-radius: 10px;
    padding: .62rem .85rem;
    font-size: .95rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sh-accent-soft);
    box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .16);
}

.form-control::placeholder {
    color: #a3adc2;
}

/* -------------------------------------------------------------- callouts */
/* The verification result page uses alert-info for its "how to use your key"
   box; Bootstrap's cyan is the one colour left over from the old palette. */

.alert-info {
    --bs-alert-bg: #f3f4fb;
    --bs-alert-border-color: #c7cdf5;
    --bs-alert-color: #312e81;
}

.alert-info code {
    background: #e3e7f8;
    color: #4338ca;
}

/* ===================================================================== badges */

.badge.bg-primary {
    background: #4f46e5 !important;
}

.badge {
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: 7px;
}

/* ============================================================== page sections */
/* Reusable building blocks for the inner pages, in the same visual language as
   the homepage. Prefixed .ps- so they never collide with Bootstrap. */

.ps-eyebrow {
    font-family: var(--sh-mono);
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sh-accent);
    margin-bottom: .7rem;
}

.hero-gradient .ps-eyebrow,
.cta-gradient .ps-eyebrow {
    color: var(--sh-accent-soft);
}

.ps-h2 {
    font-size: clamp(1.55rem, 1.1rem + 1.5vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.ps-lead {
    color: #475569;
    font-size: 1.02rem;
    max-width: 60ch;
}

.hero-gradient .ps-lead,
.cta-gradient .ps-lead {
    color: var(--sh-dim);
}

.ps-card {
    background: #fff;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 1.5rem;
}

.ps-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 .5rem;
}

.ps-card p {
    color: #475569;
    font-size: .93rem;
    margin: 0;
}

.ps-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eef1fb;
    color: #4f46e5;
    font-size: 1.05rem;
    margin-bottom: .9rem;
}

.ps-panel {
    background: #fff;
    border: 1px solid #c7cdf5;
    border-radius: 18px;
    padding: 2.25rem;
    box-shadow: 0 26px 56px -34px rgba(49, 46, 129, .6);
}

.ps-step-num {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    font-family: var(--sh-mono);
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    flex: none;
}

.ps-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.ps-step h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: .2rem 0 .3rem;
}

.ps-step p {
    color: #475569;
    font-size: .92rem;
    margin: 0;
}

/* Buy Me a Coffee injects a button with a hard-coded 360px width, which is
   wider than a small phone. Only constrain it where it would otherwise push
   the page sideways; above 576px the button is left exactly as they ship it. */

@media (max-width: 575.98px) {
    #bmc-slot {
        max-width: 100%;
        overflow-x: hidden;
    }

    #bmc-slot .bmc-btn,
    #bmc-slot .bmc-btn-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    #bmc-slot .bmc-btn-text {
        white-space: normal !important;
    }
}

.ps-compare-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--sh-radius);
}

@media (max-width: 575.98px) {
    .ps-compare th,
    .ps-compare td {
        padding: .6rem .7rem;
        white-space: nowrap;
    }
}

.ps-compare {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    overflow: hidden;
    font-size: .93rem;
}

.ps-compare th,
.ps-compare td {
    padding: .75rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid #eef0f7;
}

.ps-compare thead th {
    background: #fafbff;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.ps-compare tbody tr:last-child th,
.ps-compare tbody tr:last-child td {
    border-bottom: 0;
}

.ps-compare tbody th {
    font-weight: 600;
    color: #1e293b;
}

.ps-compare .ps-vip {
    font-weight: 700;
    color: #4338ca;
}

.ps-code {
    font-family: var(--sh-mono);
    font-size: .85em;
    white-space: nowrap;
    background: #eef1fb;
    color: #4338ca !important;
    padding: .08em .35em;
    border-radius: 5px;
}

.ps-note {
    background: #fafbff;
    border: 1px solid var(--sh-border);
    border-left: 3px solid var(--sh-accent);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    color: #475569;
    font-size: .92rem;
}

.ps-note strong {
    color: #1e293b;
}

.ps-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .85rem;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    background: rgba(129, 140, 248, .1);
    color: #c7d2fe;
    font-size: .82rem;
}

.ps-pill i {
    color: #34d399;
}

/* ----------------------------------------------- table of contents (terms) */

.ps-toc {
    position: sticky;
    top: 6.5rem;
}

.ps-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--sh-border);
}

.ps-toc li a {
    display: block;
    padding: .4rem .9rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: #64748b;
    font-size: .88rem;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease;
}

.ps-toc li a:hover {
    color: #4f46e5;
    border-left-color: #c7cdf5;
}

@media (max-width: 991.98px) {
    .ps-toc {
        position: static;
    }
}

/* -------------------------------------------------------------- legal copy */

.terms-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.015em;
    margin-bottom: .9rem;
}

.terms-content h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.terms-content p,
.terms-content li {
    color: #475569;
    line-height: 1.75;
}

.terms-content ul,
.terms-content ol {
    padding-left: 1.2rem;
}

.terms-content section {
    scroll-margin-top: 6.5rem;
}

/* ------------------------------------------- VIP toggle on the key request */
/* api-key.js adds .btn-vip to the submit button when the VIP tier is picked. */

.btn-vip {
    background-image: linear-gradient(180deg, #ec4899, #db2777) !important;
    border-color: #be185d !important;
    box-shadow: 0 10px 24px -12px rgba(219, 39, 119, .95) !important;
}

/* ===================================================================== footer */

.sh-footer {
    background: var(--sh-ink);
    border-top: 1px solid var(--sh-line);
    color: #cbd5e1;
    padding: 3.5rem 0 1.75rem;
}

.sh-footer a {
    color: var(--sh-dim);
    text-decoration: none;
    transition: color .15s ease;
}

.sh-footer a:hover {
    color: #fff;
}

.sh-footer .sh-brand-name {
    font-size: 1rem;
}

.sh-footer-about {
    color: var(--sh-dim);
    font-size: .9rem;
    max-width: 34ch;
    margin: .9rem 0 0;
}

.sh-foot-head {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #e2e8f5;
    margin-bottom: .9rem;
}

.sh-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sh-footer li {
    margin-bottom: .55rem;
    font-size: .92rem;
}

.sh-footer li i {
    display: inline-block;
    width: 1.25rem;
    margin-right: .4rem;
    text-align: center;
    color: #64748b;
}

.sh-footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sh-line);
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
    color: #64748b;
}

.sh-footer-bottom p {
    margin: 0;
}

.sh-disclaimer {
    font-family: var(--sh-mono);
    font-size: .72rem;
    color: #64748b;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    padding: .25rem .75rem;
}

@media (max-width: 575.98px) {
    .sh-footer {
        padding-top: 2.5rem;
    }

    .sh-footer-bottom {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sh-cta:hover,
    .card.shadow-sm:hover,
    .card.shadow:hover {
        transform: none;
    }
}
