/*
 * Alphie Download Page Styles
 * Extracted from website/css/style.css
 * Uses --ds-* design tokens (website system)
 */

/* Design Tokens (subset needed for download page) */
:root {
    --ds-accent: #6366F1;
    --ds-accent-bg: #EEF2FF;
    --ds-accent-dim: #818CF8;
    --ds-surface: #FAFAFA;
    --ds-border: #F0F0F0;
    --ds-border-med: #E6E6E6;
    --ds-text-primary: #1e293b;
    --ds-text-secondary: #64748b;
    --ds-text-tertiary: #94a3b8;
    --ds-bg-page: #f8fafc;
    --ds-bg-white: #ffffff;
    --success: #10b981;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-text: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --radius-md: 12px;
    --radius-xl: 20px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* Page Layout */
.download-page {
    padding-top: 0;
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

.download-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: auto;
    display: block;
    flex-direction: unset;
}

/* Gradient text utility */
.download-page .gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.download-page .badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--ds-accent-bg);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-accent);
    margin-bottom: 20px;
}

.download-page .badge .pulse {
    width: 8px;
    height: 8px;
    background: var(--ds-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Section headers */
.download-page .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.download-page .section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--ds-accent-bg);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-accent);
    margin-bottom: 16px;
}

.download-page .section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ds-text-primary);
}

/* Hero */
.download-hero {
    /* top padding must clear the position:fixed .navbar (z-index 1002, ~52px tall:
       14px*2 padding + logo). 60px left the "Alphie Desktop" badge tucked under the
       navbar's bottom edge → visibly clipped. 96px gives the badge real breathing room. */
    padding: 96px 24px 40px;
    position: relative;
    overflow: hidden;
    background: var(--ds-bg-white);
}

.download-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.download-hero h1 {
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ds-text-primary);
}

.download-hero .hero-description {
    font-size: 17px;
    margin-bottom: 0;
    color: var(--ds-text-secondary);
    line-height: 1.6;
}

/* Hero background effects */
.download-hero .hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.download-hero .grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.download-hero .gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.download-hero .orb-1 {
    width: 400px;
    height: 400px;
    background: var(--ds-accent);
    top: -200px;
    right: -100px;
}

.download-hero .orb-2 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    bottom: -150px;
    left: -50px;
}

/* Download Cards */
.download-cards-section {
    padding: 40px 0 80px;
    background: var(--ds-bg-white);
}

.download-grid {
    display: grid;
    /* Center column larger, side columns smaller — classic emphasized middle layout */
    grid-template-columns: 1fr 1.16fr 1fr;
    gap: 20px;
    align-items: center;
}

.download-card {
    background: var(--ds-bg-white);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.download-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

/* featured class removed — no selected/active effect on cards */

.featured-label {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ds-accent-bg);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-accent);
    margin-bottom: 12px;
}

.download-card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-bg-page);
    border-radius: 16px;
    margin-bottom: 20px;
    color: var(--ds-text-secondary);
}

/* featured icon style removed */

.download-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--ds-text-primary);
}

.download-card-desc {
    font-size: 14px;
    color: var(--ds-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.download-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.spec-tag {
    padding: 4px 10px;
    background: var(--ds-bg-page);
    border-radius: 6px;
    font-size: 12px;
    color: var(--ds-text-tertiary);
    border: 1px solid var(--ds-border);
}

.download-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.download-card-actions .btn-dl-primary,
.download-card-actions .btn-dl-secondary {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-dl-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-dl-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-dl-secondary {
    background: var(--ds-bg-white);
    color: var(--ds-text-primary);
    border: 1px solid var(--ds-border-med) !important;
}

.btn-dl-secondary:hover {
    border-color: var(--ds-accent) !important;
    color: var(--ds-accent);
}

.btn-dl-secondary.copied {
    border-color: var(--success) !important;
    color: var(--success);
}

.download-card-terminal {
    background: var(--ds-bg-page);
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid var(--ds-border);
}

.download-card-terminal code {
    font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
    font-size: 12px;
    color: var(--ds-text-secondary);
    word-break: break-all;
}

/* Steps Section */
.download-steps-section {
    background: var(--ds-bg-page);
    padding: 80px 0;
}

.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    max-width: 900px;
    margin: 0 auto;
}

.step-card {
    flex: 1;
    text-align: center;
    padding: 0 24px;
}

.step-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 14px;
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin: 0 auto 16px;
}

.step-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--ds-text-primary);
}

.step-card p {
    font-size: 14px;
    color: var(--ds-text-secondary);
    line-height: 1.6;
}

.step-arrow {
    display: flex;
    align-items: center;
    padding-top: 12px;
    color: var(--ds-text-tertiary);
    flex-shrink: 0;
}

/* Capabilities Section */
.download-capabilities-section {
    background: var(--ds-bg-white);
    padding: 80px 0;
}

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.capability-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--ds-bg-page);
    border-radius: var(--radius-md);
    border: 1px solid var(--ds-border);
    transition: all var(--transition-fast);
}

.capability-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
    background: var(--ds-bg-white);
    box-shadow: var(--shadow-sm);
}

.capability-icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.capability-item div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.capability-item strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-text-primary);
}

.capability-item span {
    font-size: 13px;
    color: var(--ds-text-secondary);
    line-height: 1.5;
}

/* Security Section */
.download-security-section {
    background: var(--ds-bg-page);
    padding: 60px 0;
}

.security-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
    background: var(--ds-bg-white);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.security-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 14px;
    color: var(--success);
    flex-shrink: 0;
}

.security-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--ds-text-primary);
}

.security-content p {
    font-size: 14px;
    color: var(--ds-text-secondary);
    line-height: 1.7;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .download-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    /* Single-column stack: drop the center-emphasis lift so cards align cleanly,
       and restore natural macOS → Windows → Linux source order (ignore dl-* ordering) */
    .download-grid .download-card.dl-left,
    .download-grid .download-card.dl-center,
    .download-grid .download-card.dl-right { order: 0; }
    .download-card.featured {
        transform: none;
        padding: 36px 28px;
    }
    .download-card.featured:hover {
        transform: translateY(-4px);
    }

    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .download-hero {
        /* mobile navbar is fixed too — keep the badge below it */
        padding: 80px 16px 30px;
    }

    .download-hero h1 {
        font-size: 2rem;
    }

    .download-hero .hero-description {
        font-size: 15px;
    }

    .download-cards-section {
        padding: 20px 0 40px;
    }

    .download-card {
        padding: 28px 20px;
    }

    .steps-grid {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .step-arrow {
        transform: rotate(90deg);
        padding-top: 0;
    }

    .capabilities-grid {
        grid-template-columns: 1fr;
    }

    .security-card {
        flex-direction: column;
        padding: 24px;
    }

    .download-steps-section,
    .download-capabilities-section {
        padding: 40px 0;
    }
}

/* My Agents Section */
/* Download button spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Tauri Desktop narrative — ported canonical layout classes
   (featured card / coming-soon / arch chooser / note / disabled)
   Added during download-page unification (App visual = canonical).
   ============================================================ */
.download-card { position: relative; }

.download-card.featured {
    /* Selected/recommended = clean full purple border (all four corners), no top stripe */
    border: 2px solid var(--ds-accent);
    box-shadow: 0 14px 44px rgba(99, 102, 241, 0.18);
    padding: 44px 32px;
    transform: translateY(-8px);
    z-index: 1;
}
.download-card.featured:hover {
    border-color: var(--ds-accent);
    box-shadow: 0 20px 52px rgba(99, 102, 241, 0.24);
    transform: translateY(-12px);
}

/* Position the cards into the 3 columns via order classes (NOT source order),
   so JS can move the visitor's-OS card into the larger CENTER column at runtime.
   Default (no-JS / SSR fallback): macOS center, Windows left, Linux right. */
.download-grid .download-card.dl-left   { order: 1; }  /* left column  */
.download-grid .download-card.dl-center { order: 2; }  /* center (wide) column */
.download-grid .download-card.dl-right  { order: 3; }  /* right column */

.coming-soon-label {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-text-tertiary);
    margin-bottom: 12px;
}

.download-card-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--ds-text-tertiary);
    line-height: 1.5;
}

/* Architecture / format chooser (manual override links under primary button) */
.download-arch-alt {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ds-border);
    font-size: 12px;
    color: var(--ds-text-tertiary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.download-arch-alt-label { color: var(--ds-text-tertiary); font-weight: 500; }
.download-arch-alt-links { display: inline-flex; align-items: center; gap: 6px; }
.download-arch-alt-links a {
    color: var(--ds-text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
    padding: 2px 0;
}
.download-arch-alt-links a:hover { color: var(--ds-accent, #6366f1); text-decoration: underline; }
.download-arch-alt-links a small { font-weight: 400; color: var(--ds-text-tertiary); margin-left: 3px; }
.download-arch-divider { color: var(--ds-text-tertiary); opacity: 0.5; }

.download-card .btn-dl-secondary[disabled],
.download-card .btn-dl-primary[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}
.download-card .btn-dl-secondary[disabled]:hover,
.download-card .btn-dl-primary[disabled]:hover {
    transform: none;
    background: var(--ds-surface-elev, var(--ds-surface));
}

a.download-btn { text-decoration: none; }
