/**
 * Download and Licence pages
 *
 * Both sit on top of the landing design system in feature-page-landing.css and
 * only add what those pages need: the two channel cards, the line of facts
 * under the direct download, and the states that line takes when there is no
 * build to offer.
 */

/* ==========================================================================
   Hero — shorter than a feature page's
   ========================================================================== */

/* A feature page opens on a full screen of promise. These two are errands:
   somebody arrives to get the app or to find their key, and 80vh of hero puts
   the thing they came for below the fold. */
.download-page .feature-hero,
.licence-page .feature-hero {
    min-height: 0;
    padding: calc(var(--space-2xl) + 100px) 0 var(--space-xl);
}

.licence-page .licence-note {
    margin-top: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   The two channels
   ========================================================================== */

.download-page .download-channels {
    padding: 0 0 var(--space-3xl);
}

/* Three cards across on a desktop, and the floor is what decides it: 340px
   fitted two and wrapped the third onto a row of its own. */
.download-page .download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-md);
    align-items: stretch;
}

.download-page .download-card {
    display: flex;
    flex-direction: column;
    background: var(--gradient-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.download-page .download-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-lg);
}

/* The direct build is what this page exists for; the App Store card is the
   alternative beside it, not the other way round. */
.download-page .download-card--direct {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: var(--shadow-glow);
}

.download-page .download-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--gradient-glow);
    font-size: var(--font-size-xl);
    color: var(--color-text-primary);
}

.download-page .download-card-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.download-page .download-card-body {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.download-page .download-points {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-lg);
}

.download-page .download-points li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    padding: 0.35rem 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.download-page .download-points i {
    margin-top: 0.3em;
    font-size: 0.8em;
    color: var(--color-accent);
}

/* A limitation, not a feature: it sits below the ticks, in the muted colour and
   without one, so it cannot be skimmed as another thing the web app does. */
.download-page .download-card-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    margin: 0 0 var(--space-lg);
    padding-top: var(--space-xs);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    line-height: 1.6;
    color: var(--color-text-muted);
}

.download-page .download-card-note i {
    margin-top: 0.25em;
    opacity: 0.7;
}

/* Pushed to the bottom so the two buttons line up even when one card carries a
   longer paragraph than the other. */
.download-page .download-card-action {
    margin-top: auto;
}

.download-page .download-card-action .btn-cta {
    width: 100%;
}

/* ==========================================================================
   The line of facts under the download button
   ========================================================================== */

.download-page .download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
    margin: var(--space-md) 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.download-page .download-meta i {
    color: var(--color-accent);
}

/* ==========================================================================
   When there is nothing to download
   ========================================================================== */

.download-page .download-state {
    padding: var(--space-md);
    border: 1px dashed var(--color-border-hover);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.download-page .download-state h3 {
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin: 0 0 var(--space-xs);
    color: var(--color-text-primary);
}

.download-page .download-state p {
    margin: 0;
    font-size: var(--font-size-xs);
    line-height: 1.7;
    color: var(--color-text-muted);
}

.download-page .download-state a {
    color: var(--color-primary-light);
}

.download-page .download-state--error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.08);
}

/* ==========================================================================
   The four cards below
   ========================================================================== */

/* Both pages carry exactly four, and the shared grid fits three across at this
   width — which leaves the fourth alone on a row of its own and reading like an
   afterthought. Two by two instead. */
.download-page .features-grid-section .feature-grid,
.licence-page .features-grid-section .feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* ==========================================================================
   Inline links inside the cards below
   ========================================================================== */

.download-page .download-inline-link,
.licence-page .feature-grid-item a {
    color: var(--color-primary-light);
    text-decoration: none;
    font-weight: 600;
}

.download-page .download-inline-link:hover,
.licence-page .feature-grid-item a:hover {
    color: var(--color-accent);
}

.download-page .download-inline-link i {
    font-size: 0.8em;
    transition: transform var(--transition-fast);
}

.download-page .download-inline-link:hover i {
    transform: translateX(3px);
}

.licence-page .closing-cta-section .section-body a {
    color: var(--color-primary-light);
}

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 768px) {
    .download-page .feature-hero,
    .licence-page .feature-hero {
        padding: calc(var(--space-xl) + 80px) 0 var(--space-lg);
    }

    .download-page .download-grid {
        grid-template-columns: 1fr;
    }

    .download-page .download-card {
        padding: var(--space-lg);
    }
}
