/* ============================================
   COMPONENTS
   Reusable elements used across multiple sections:
   buttons, brand logo, dev banner.
   Section-specific cards live in sections.css.
   ============================================ */

/* ------ Buttons ------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-body);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), #5e1bbf);
    color: white;
    border-color: var(--border-strong);
    box-shadow: 0 0 24px rgba(139, 61, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 36px rgba(139, 61, 255, 0.7);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(139, 61, 255, 0.12);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-acid {
    background: transparent;
    color: var(--acid);
    border-color: rgba(182, 255, 60, 0.4);
}

.btn-acid:hover {
    background: rgba(182, 255, 60, 0.1);
    border-color: var(--acid);
    color: var(--acid-glow);
    box-shadow: var(--shadow-glow-acid);
}

/* ------ Download CTA (wired by scripts/download.js) ------
   Variant of .btn that ships in 3 visual states:
   .is-loading   — version being fetched (subdued, busy cursor)
   .is-ready     — version resolved, direct download URL set
   .is-fallback  — mobile / fetch error, opens landing in new tab */
.btn-download {
    background: linear-gradient(135deg, var(--acid) 0%, #7fbf2a 100%);
    color: #0a0014;
    border-color: var(--acid);
    box-shadow: 0 0 28px rgba(182, 255, 60, 0.45);
    font-weight: 700;
    position: relative;
    padding: 14px 26px 14px 22px;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(182, 255, 60, 0.75);
    color: #0a0014;
}

.btn-download .btn-download-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.btn-download .btn-download-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    gap: 2px;
}

.btn-download .btn-download-label {
    font-size: 14px;
}

.btn-download-version {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: none;
    opacity: 0.85;
}

.btn-download.is-loading {
    cursor: progress;
    opacity: 0.8;
}

.btn-download.is-loading .btn-download-version::before {
    content: '...';
}

.btn-download.is-fallback {
    /* Switch to a secondary look since it'll open a landing, not download directly */
    background: rgba(182, 255, 60, 0.08);
    color: var(--acid);
    border-color: rgba(182, 255, 60, 0.4);
    box-shadow: none;
}

/* ------ Brand logo (used in nav, footer, anywhere) ------
   Background removal via SVG filter (defined inline in index.html).
   See: <filter id="bgKnockoutDark"> */
.brand-logo-img {
    display: block;
    height: 38px;
    width: auto;
    filter:
        url(#bgKnockoutDark)
        drop-shadow(0 0 12px rgba(139, 61, 255, 0.35));
}

.footer .brand-logo-img {
    height: 44px;
}

@media (max-width: 600px) {
    .brand-logo-img { height: 30px; }
}

/* ============================================
   MODAL
   Generic modal used for Disclaimer (and any future modal).
   Open/close logic in scripts/ui.js — triggered by [data-modal-open="id"].
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 0, 13, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 2;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: 40px 36px 32px;
    max-width: 720px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 50px rgba(139, 61, 255, 0.2);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}

.modal.open .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--gold);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.modal-content p:last-child {
    margin-bottom: 0;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.modal-close:hover {
    color: var(--acid);
    border-color: var(--acid);
    transform: rotate(90deg);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 560px) {
    .modal-content {
        padding: 32px 22px 24px;
        max-height: calc(100vh - 40px);
    }
}

/* ------ Dev banner ------ */
.dev-banner {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: rgba(245, 196, 65, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 14px;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    z-index: 200;
    backdrop-filter: blur(8px);
    pointer-events: none;
}
