/* ═══════════════════════════════════════
   RTW88 WiFi Driver Installer
   ═══════════════════════════════════════ */

/* ── Tokens ── */

:root {
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --bg: #13161b;
    --surface: #1a1e25;
    --primary: #34bec9;
    --primary-hover: #2ca8b2;
    --primary-soft: rgba(52, 190, 201, 0.1);
    --primary-line: rgba(52, 190, 201, 0.22);
    --text: #e2e5ea;
    --text-muted: #7c8290;
    --border: rgba(255, 255, 255, 0.07);
    --code-bg: #0e1117;
    --success: #10b981;
    --warning: #f59e0b;
    --glow: rgba(52, 190, 201, 0.06);
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
    --bg: #f2f4f7;
    --surface: #ffffff;
    --primary: #0e8e9b;
    --primary-hover: #0c7a85;
    --primary-soft: rgba(14, 142, 155, 0.07);
    --primary-line: rgba(14, 142, 155, 0.18);
    --text: #181b20;
    --text-muted: #5b616e;
    --border: rgba(0, 0, 0, 0.06);
    --code-bg: #171b22;
    --success: #059669;
    --warning: #d97706;
    --glow: rgba(14, 142, 155, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.09);
}

/* ── Reset ── */

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

/* ── Base ── */

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, var(--glow), transparent);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 860px;
    margin: 0 auto;
}

/* ── Header ── */

header {
    text-align: center;
    padding: 48px 20px 40px;
    margin-bottom: 44px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--primary), #5fd4e4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.5;
}

.badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: border-color 0.2s;
}

.badge:hover {
    border-color: var(--primary);
}

.badge svg {
    width: 15px;
    height: 15px;
    fill: var(--primary);
}

/* ── Cards ── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: border-color 0.25s, box-shadow 0.25s;
}

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

.card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.card > p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Card entrance animation ── */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

main > .card {
    opacity: 0;
    animation: fadeUp 0.4s ease-out forwards;
}

main > .card:nth-child(1) { animation-delay: 0.03s; }
main > .card:nth-child(2) { animation-delay: 0.08s; }
main > .card:nth-child(3) { animation-delay: 0.13s; }
main > .card:nth-child(4) { animation-delay: 0.18s; }
main > .card:nth-child(5) { animation-delay: 0.23s; }
main > .card:nth-child(6) { animation-delay: 0.28s; }

/* ── Terminal command box ── */

.terminal {
    background: var(--code-bg);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.terminal-title {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: #6e7681;
    flex: 1;
}

.terminal-body {
    display: block;
    font-family: var(--mono);
    font-size: 0.88rem;
    color: #79c0ff;
    padding: 16px 20px;
    white-space: pre;
    overflow-x: auto;
    line-height: 1.6;
    cursor: pointer;
    -webkit-user-select: all;
    user-select: all;
}

.terminal-body::before {
    content: '$ ';
    color: #6e7681;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Copy button ── */

.copy-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
    margin-left: auto;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

.copy-btn.copied {
    background: var(--success);
}

.copy-btn svg {
    width: 13px;
    height: 13px;
    fill: #fff;
}

/* ── Notice callout ── */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-top: 16px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    border-radius: 8px;
}

.notice svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: var(--primary);
    margin-top: 1px;
}

.notice p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.notice code {
    font-family: var(--mono);
    font-size: 0.82rem;
    background: var(--primary-soft);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--primary);
}

/* ── Steps timeline ── */

.steps {
    margin-top: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 24px;
    position: relative;
}

.step:last-child {
    padding-bottom: 0;
}

/* Connecting line between step circles */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--primary-line);
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step-body {
    padding-top: 6px;
}

.step-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.step-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ── Info grid ── */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.grid-item {
    padding: 18px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.grid-item:hover {
    border-color: var(--primary);
}

.grid-item h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.grid-item p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Chipsets ── */

.chipsets {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chipset {
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
    padding: 14px 18px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chipset:hover {
    background: var(--primary-line);
}

.chipset h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.chipset p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── Post-install steps ── */

.post-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.post-steps code {
    font-family: var(--mono);
    font-size: 0.82rem;
    background: var(--primary-soft);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--primary);
}

/* ── Footer ── */

footer {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
    font-size: 0.88rem;
    border-top: 1px solid var(--border);
    margin-top: 44px;
}

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

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

/* ── Theme toggle ── */

.theme-toggle {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 8px;
}

.theme-toggle button {
    font-family: var(--font);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    font-size: 0.82rem;
    transition: border-color 0.2s;
    box-shadow: var(--shadow);
}

.theme-toggle button:hover {
    border-color: var(--primary);
}

/* ── Responsive ── */

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    header {
        padding: 32px 12px 28px;
        margin-bottom: 32px;
    }

    .card {
        padding: 22px 18px;
        margin-bottom: 18px;
    }

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

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

    .terminal-body {
        font-size: 0.78rem;
        padding: 12px 14px;
    }

    .step {
        gap: 14px;
    }

    .step-num {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .step:not(:last-child)::after {
        left: 15px;
    }

    .theme-toggle {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .card {
        padding: 18px 16px;
    }

    .terminal-bar {
        padding: 8px 12px;
    }

    .terminal-body {
        font-size: 0.72rem;
        padding: 12px;
    }
}
