:root {
    --bg-0: #0c0a12;
    --bg-1: #14101f;
    --bg-2: #1c1629;
    --purple-1: #7c3aed;
    --purple-2: #a78bfa;
    --purple-glow: rgba(124, 58, 237, 0.45);
    --text-0: #f2f0f7;
    --text-1: #b8b2c9;
    --text-2: #7a7390;
    --border: rgba(167, 139, 250, 0.16);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
    color: var(--text-0);
    background:
        radial-gradient(60vw 60vw at 15% -10%, rgba(124, 58, 237, 0.20), transparent 60%),
        radial-gradient(70vw 70vw at 110% 10%, rgba(167, 139, 250, 0.14), transparent 55%),
        var(--bg-0);
    background-attachment: fixed;
}

#matrix-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
}

.nav, .hero, .site-footer, .page {
    position: relative;
    z-index: 1;
}

.content-panel {
    position: relative;
    background: rgba(12, 10, 18, 0.55);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: clamp(3.5rem, 9vw, 4.25rem) clamp(1.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}

.hero .content-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.25rem;
    max-width: 42rem;
}

/* ---------- Nav ---------- */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem clamp(1.25rem, 5vw, 4rem);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: clamp(1.35rem, 3.2vw, 1.75rem);
    letter-spacing: 0.02em;
    color: var(--text-0);
    text-decoration: none;
}

.brand-mark {
    position: relative;
    z-index: 2;
    width: clamp(2.5rem, 6vw, 3.25rem);
    height: clamp(2.5rem, 6vw, 3.25rem);
    margin: clamp(-0.65rem, -1.5vw, -0.5rem) 0;
    flex-shrink: 0;
    display: block;
    filter: drop-shadow(0 6px 16px var(--purple-glow));
}

.nav-link {
    color: var(--text-1);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
    color: var(--text-0);
    border-color: var(--border);
    background: rgba(167, 139, 250, 0.06);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ---------- Desktop app status indicator ---------- */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
}

.content-panel .status-indicator,
.page .status-indicator {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--text-2);
    flex-shrink: 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-indicator.live {
    color: #4ade80;
}

.status-indicator.live .status-dot {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.status-indicator.offline {
    color: #f87171;
}

.status-indicator.offline .status-dot {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.7);
}

/* ---------- Main / hero (download page) ---------- */

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 4rem;
    gap: 2.25rem;
}

.hero-eyebrow {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--purple-2);
    font-weight: 600;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 20%, var(--purple-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.subtitle {
    max-width: 34rem;
    margin: 0;
    color: var(--text-1);
    font-size: 1.05rem;
    line-height: 1.6;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 2.6rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, var(--purple-1), #9333ea);
    box-shadow: 0 10px 30px -6px var(--purple-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -6px var(--purple-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.download-btn:active {
    transform: translateY(0);
}

/* Placeholder state until the Windows build is downloadable - flip back to an
   <a href download> in the same change that sets health.json "app": "live". */
.download-btn.is-disabled {
    cursor: default;
    opacity: 0.6;
    box-shadow: none;
}

.download-btn.is-disabled:hover,
.download-btn.is-disabled:active {
    transform: none;
    box-shadow: none;
}

.download-btn svg {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
}

.download-meta {
    color: var(--text-2);
    font-size: 0.85rem;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem clamp(1.25rem, 5vw, 4rem);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    color: var(--text-2);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--text-1);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-footer a:hover {
    color: var(--purple-2);
    border-color: var(--purple-2);
}

/* ---------- Support page content ---------- */

.page {
    position: relative;
    flex: 1;
    width: 100%;
    max-width: 40rem;
    margin: 2rem auto 3rem;
    padding: clamp(3.5rem, 9vw, 4rem) clamp(1.25rem, 5vw, 2.5rem) clamp(1.75rem, 5vw, 3rem);
    background: rgba(12, 10, 18, 0.55);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 20%, var(--purple-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page p.lead {
    color: var(--text-1);
    line-height: 1.6;
    margin-top: 0;
}

.page p.lead a {
    color: var(--purple-2);
    margin-left: 0.5rem;
}

/* ---------- Legal page tabs ---------- */

.legal-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.legal-tab {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background-color: #333138;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.6rem 1.3rem;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.legal-tab:hover {
    color: #ffffff;
    background-color: #403d47;
}

.legal-tab.active {
    color: #ffffff;
    background-color: #4a4753;
    border-color: var(--purple-2);
}

.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}

.card h2 {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: var(--text-0);
}

.card p, .card li {
    color: var(--text-1);
    line-height: 1.6;
    font-size: 0.95rem;
}

.card a {
    color: var(--purple-2);
}
