/* ── Download Page — "Deep Signal" redesign ── */
/* NOTE: relies on phantom.css .card having no ::before / ::after pseudo-elements */


/* ── Keyframes ── */

@keyframes state-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring-outer {
    0%   { transform: scale(1);    opacity: .45; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}
@keyframes pulse-ring-inner {
    0%   { transform: scale(1);   opacity: .3; }
    70%  { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1.3); opacity: 0; }
}
@keyframes icon-glow-primary {
    0%, 100% { box-shadow: 0 0 0 0 rgba(58,141,255,0); }
    50%       { box-shadow: 0 0 28px 4px rgba(58,141,255,.22); }
}
@keyframes icon-glow-success {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
    50%       { box-shadow: 0 0 28px 4px rgba(34,197,94,.28); }
}
@keyframes icon-glow-error {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    50%       { box-shadow: 0 0 40px 8px rgba(239,68,68,.38); }
}
@keyframes btn-breath {
    0%, 100% { box-shadow: 0 0 28px rgba(34,197,94,.28), 0 4px 14px rgba(34,197,94,.18); }
    50%       { box-shadow: 0 0 60px rgba(34,197,94,.60), 0 8px 32px rgba(34,197,94,.38); }
}
@keyframes qr-glow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.35), 0 0 20px rgba(34,197,94,.12); }
    50%       { box-shadow: 0 0 0 4px rgba(34,197,94,.60), 0 0 40px rgba(34,197,94,.28); }
}

/* ── Page layout ── */

.dl-mobile-wrap {
    max-width: 480px;
    margin: 0 auto;
}

/* ── State blocks ── */

[x-show] {
    animation: state-in .35s cubic-bezier(.22,.68,0,1.1) both;
}

/* ── Typography ── */

.dl-heading {
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.03em;
    margin-top: .75rem;
    color: var(--text);
}

.label-section::before {
    content: '— ';
    color: #22C55E;
}

.dl-subline {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .04em;
}

.dl-trust-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .06em;
    text-align: center;
    opacity: .75;
}

/* ── Cards — gradient left accent + grain texture ── */

.card {
    position: relative;
    overflow: hidden;
}

/* Left gradient accent bar (4px) */
.card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    transition: background .25s;
    z-index: 1;
}

.card:has(.dot-success)::before  { background: linear-gradient(to bottom, #22c55e, rgba(34,197,94,0)); }
.card:has(.dot-primary)::before  { background: linear-gradient(to bottom, #3a8dff, rgba(58,141,255,0)); }
.card:has(.dot-warning)::before  { background: linear-gradient(to bottom, #f59e0b, rgba(245,158,11,0)); }
.card:has(.dot-error)::before    { background: linear-gradient(to bottom, #ef4444, rgba(239,68,68,0)); }
.dl-version-card::before         { background: linear-gradient(to bottom, #22c55e, rgba(34,197,94,0)); }

/* Subtle SVG fractalNoise grain overlay */
.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
    z-index: 0;
}

/* ── Pulse ring (CTA anchor) ── */

.dl-cta-anchor {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dl-pulse-ring {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dl-pulse-ring::before,
.dl-pulse-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(34,197,94,.55);
}
.dl-pulse-ring::before { animation: pulse-ring-outer 2.4s cubic-bezier(.2,.6,.4,1) infinite; }
.dl-pulse-ring::after  { animation: pulse-ring-inner 2.4s cubic-bezier(.2,.6,.4,1) .6s infinite; }

.dl-pulse-ring__inner {
    position: relative;
    z-index: 2;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(34,197,94,.15);
    border: 2px solid rgba(34,197,94,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--success);
    box-shadow: 0 0 32px rgba(34,197,94,.2);
}

/* ── Download CTA button ── */

.btn-dl-cta {
    animation: btn-breath 3s ease-in-out infinite;
    font-size: 17px;
    font-weight: 700;
    height: 58px;
    letter-spacing: -.01em;
}

/* ── Terminal version block ── */

.dl-terminal {
    background: rgba(0,0,0,.30);
    border-left: 3px solid var(--success);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.version-dl {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.vrow {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.vkey {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    min-width: 76px;
    flex-shrink: 0;
    font-family: 'Courier New', Courier, monospace;
}

.vval {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.vval--mono {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

/* ── Progress bar (STARTED state) ── */

.dl-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--success), #3a8dff);
    border-radius: 0 2px 2px 0;
    transition: width 3s cubic-bezier(.4,0,.2,1);
    z-index: 9999;
}

/* ── Icon boxes ── */

.icon-box {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 1.125rem;
    font-size: 1.75rem;
}

.icon-box-primary { animation: icon-glow-primary 3s ease-in-out infinite; }
.icon-box-success { animation: icon-glow-success 3s ease-in-out infinite; }
.icon-box-error   { animation: icon-glow-error   2s ease-in-out infinite; }

/* ── Error glow wrapper (FAILED state) ── */

.dl-error-glow {
    display: inline-block;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(239,68,68,.18) 0%, transparent 70%);
    padding: 12px;
}

/* ── Install guide chevron ── */

.guide-chevron {
    display: inline-block;
    font-style: normal;
    transition: transform .3s cubic-bezier(.22,.68,0,1.2);
    color: var(--primary);
    font-size: 10px;
    margin-right: 2px;
}

/* ── Steps list accent ── */

.steps li::before {
    background: rgba(58,141,255,.15);
}

/* ── Desktop QR ── */

.dl-qr-card__title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 16px;
}

.dl-qr-frame {
    display: inline-flex;
    border-radius: 16px;
    border: 2px solid rgba(34,197,94,.55);
    padding: 10px;
    animation: qr-glow 2.5s ease-in-out infinite;
    background: rgba(17,29,47,.6);
}

.dl-qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
}

#qrcode {
    display: block;
}

#qrcode canvas,
#qrcode img {
    border-radius: 10px;
    display: block;
    animation: none;
}

/* ── Desktop grid ── */

.desktop-grid {
    align-items: start;
}

.desktop-grid > div:first-child {
    padding-right: 1.5rem;
    border-right: 1px solid rgba(255,255,255,.06);
}

@media (min-width: 860px) {
    .desktop-grid .gap-stack {
        max-width: none;
    }
}

@media (max-width: 860px) {
    .desktop-grid > div:first-child {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.06);
        padding-bottom: 2rem;
        margin-bottom: .5rem;
    }
}
