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

:root {
  --text: #F9FAFB;
  --background: #111827;
  --primary: #1F2937;
  --secondary: #9CA3AF;
  --accent: #3B82F6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.container {
    background: var(--primary);
    border-radius: 8px;
    padding: 60px 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 600px;
    width: 90%;
    margin: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text); /* Changed from --background to --text for proper contrast. */
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary); /* Now has proper contrast on the --primary background. */
    margin-bottom: 15px;
    font-weight: 400;
}

.tagline {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 5px;
}

.source-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.source-link:hover {
    color: var(--text);
}

.source-link:hover .github-icon {
    opacity: 0.9;
}

.divider {
    height: 35px;
    
    /* 1. This now controls the ACTUAL color of the wave */
    background-color: var(--secondary);

    /* 2. Use the SVG as a stencil (mask) */
    -webkit-mask-image: url("wavy-divider.svg");
    mask-image: url("wavy-divider.svg");
    
    /* 3. Repeat the stencil horizontally */
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    
    /* 4. Center the stencil */
    -webkit-mask-position: center;
    mask-position: center;

    border: 0;
}

.download-section {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.download-btn {
    display: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    background: var(--accent);
    border-radius: 6px;
    border: none;
    transition: all 0.2s ease-in-out;
    min-width: 120px;
    text-align: center;
}

.download-btn:hover {
    background: #2563EB;
    transform: translateY(-1px);
}

/* Smaller platform buttons for the main section */
.platform-btn {
    padding: 10px 18px;
    font-size: 0.95rem;
}

/* Even more compact buttons for the expanded section */
.compact-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-width: 140px;
}

.view-all-downloads {
    margin: 20px 0;
}

.view-all-btn {
    background: none;
    border: none;
    color: var(--secondary); /* Changed from --accent to fix contrast issues. This is a secondary action. */
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 auto;
    padding: 8px 12px;
    border-radius: 4px;
    transition: color 0.2s;
}

.view-all-btn:hover {
    color: var(--text); /* Simple, effective hover: text becomes brighter. */
}

.caret {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    transform-origin: center;
}

.caret.rotated {
    transform: rotate(180deg);
}

.instructions {
    margin-top: 30px;
    padding: 20px;
    background: var(--background); /* Darker box inside the container. */
    border-radius: 10px;
    border-left: 4px solid var(--accent);
    color: var(--text);
    display: none;
}

.instructions strong {
    color: var(--accent); /* Use accent color to highlight important words. */
}

code {
    background: var(--background); /* Darker background for code snippets for better contrast and separation. */
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--text);
    font-size: 0.9rem;
}

.os-info {
    margin-top: 20px;
    padding: 15px;
    background: var(--background); /* Simplified and made consistent with other info boxes. */
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fallback-downloads {
    margin-top: 15px;
    padding: 20px;
    background: var(--background);
    border-radius: 10px;
    border: 2px dashed var(--secondary);
}

.fallback-downloads.hidden {
    display: none;
}

.fallback-downloads h3 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.1rem;
}

.fallback-downloads .download-btn {
    display: inline-block;
    margin: 5px 10px;
}

/* Grid layout for all downloads section */
.all-downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
}

.footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    filter: brightness(0.85);
}

.github-icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer a:hover .github-icon {
    filter: brightness(0.85);
}

@media (max-width: 768px) {
    .container {
        padding: 40px 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .download-section {
        flex-direction: column;
        align-items: center;
    }

    .download-btn {
        width: 100%;
        max-width: 250px;
    }

    .platform-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .all-downloads-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .compact-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}