*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #2d8fd5;
    --blue-dark: #1a6fa8;
    --blue-light: #e8f4fc;
    --red: #d93025;
    --red-dark: #b71c1c;
    --white: #ffffff;
    --grey-50: #f8f9fa;
    --grey-100: #f1f3f4;
    --grey-200: #e8eaed;
    --grey-600: #5f6368;
    --grey-800: #3c4043;
    --grey-900: #202124;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--grey-50);
    color: var(--grey-800);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 16px;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--grey-900);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--grey-600);
    font-size: 1.05rem;
}

/* Detection banner */

.detected-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--blue-light);
    color: var(--blue-dark);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.detect-icon {
    font-size: 1.2rem;
}

/* Download cards */

.download-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.download-card {
    background: var(--white);
    border: 2px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.download-card:hover {
    box-shadow: var(--shadow-hover);
}

.download-card.recommended {
    border-color: var(--blue);
    box-shadow: var(--shadow);
    position: relative;
}

.download-card.recommended::before {
    content: "Recommended";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-icon {
    color: var(--blue);
    margin-bottom: 0.75rem;
}

.download-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--grey-900);
    margin-bottom: 0.25rem;
}

.download-card p {
    font-size: 0.85rem;
    color: var(--grey-600);
    margin-bottom: 1.25rem;
}

.download-btn {
    display: inline-block;
    padding: 0.6rem 2rem;
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
    margin-top: auto;
}

.download-btn:hover {
    background: var(--blue-dark);
}

.download-card.recommended .download-btn {
    background: var(--red);
}

.download-card.recommended .download-btn:hover {
    background: var(--red-dark);
}

/* Instructions */

.instructions-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.instructions-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--grey-900);
    margin-bottom: 1.25rem;
}

.instructions-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--grey-200);
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--grey-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--blue);
}

.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content ol {
    list-style: none;
    counter-reset: steps;
}

.tab-content ol li {
    counter-increment: steps;
    padding: 0.75rem 0 0.75rem 3rem;
    position: relative;
    border-bottom: 1px solid var(--grey-100);
}

.tab-content ol li:last-child {
    border-bottom: none;
}

.tab-content ol li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 2rem;
    height: 2rem;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.tab-content ol li strong {
    display: block;
    color: var(--grey-900);
    margin-bottom: 0.15rem;
}

.tab-content ol li p {
    color: var(--grey-600);
    font-size: 0.9rem;
}

.tab-content ol li code {
    background: var(--grey-100);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--grey-900);
}

/* Footer */

footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--grey-200);
}

footer p {
    color: var(--grey-600);
    font-size: 0.85rem;
}

footer a {
    color: var(--blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Download hint ─────────────────────────────────────────────────────────── */

.download-hint {
    position: fixed;
    z-index: 1000;
    max-width: 300px;
    background: var(--grey-900);
    color: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem 1rem 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.download-hint--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Top-right variant: sits below the browser toolbar with arrow pointing up-right */
.download-hint--top-right {
    top: 16px;
    right: 16px;
    transform: translateY(-12px);
}

.download-hint--top-right.download-hint--visible {
    transform: translateY(0);
}

/* Curved arrow pointing up toward the browser's download button */
.download-hint__arrow {
    position: absolute;
    top: -28px;
    right: 18px;
    width: 28px;
    height: 28px;
    background: transparent;
}

.download-hint__arrow::before {
    content: "";
    position: absolute;
    right: 4px;
    top: 0;
    width: 16px;
    height: 22px;
    border-right: 2.5px solid var(--white);
    border-top: 2.5px solid var(--white);
    border-radius: 0 8px 0 0;
    opacity: 0.85;
}

/* Arrowhead */
.download-hint__arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--white);
    opacity: 0.85;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}

.download-hint--visible .download-hint__arrow {
    animation: hint-bounce 1s ease-in-out infinite;
}

.download-hint__body {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.download-hint__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: #34a853;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 1px;
}

.download-hint__body p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.download-hint__body p strong {
    color: var(--white);
}

.download-hint__close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.15s;
}

.download-hint__close:hover {
    color: var(--white);
}

/* Responsive */

@media (max-width: 600px) {
    .container {
        padding: 1.25rem 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

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

    .instructions-section {
        padding: 1.25rem;
    }
}
