/* ============================================================
 * xpopup.css -- the landing-page stylesheet for the xPopUp info
 * site. Dark, purple-accented aesthetic mirroring the QML app.
 *
 * Loaded on every page (alongside docs.css for the privacy/terms
 * docs-shell). Pages either render under _landing.html (clean
 * marketing chrome) or _layout.html (2-column docs shell).
 *
 * Colour tokens are defined under :root so they can be picked up
 * by both the landing and docs layouts and overridden per-page
 * when needed.
 * ============================================================ */

:root {
    /* Dark palette mirroring app/Theme.qml. */
    --xp-bg:         #000000;
    --xp-surface:    #0d0d0d;
    --xp-surface-2:  #1a1a1a;
    --xp-border:     #1f1f1f;
    --xp-fg:         #ffffff;
    --xp-muted:      #8a8a8a;
    --xp-accent:     #a855f7;
    --xp-accent-2:   #5b2c9e;
    --xp-accent-soft: rgba(168, 85, 247, 0.16);
    --xp-accent-glow: rgba(168, 85, 247, 0.45);

    /* Layout tokens. */
    --xp-radius-sm:  12px;
    --xp-radius-md:  16px;
    --xp-radius-lg:  20px;
    --xp-radius-xl:  28px;
    --xp-pill:       999px;

    --xp-topnav-h:   72px;
}

/* ============================================================
 * Reset + body
 * ============================================================ */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--xp-bg);
    color: var(--xp-fg);
}

body.landing-body,
body.docs-body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: var(--xp-bg);
    color: var(--xp-fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Low-specificity global link rule (0,0,0,1) so every more specific
 * rule below (.btn-primary, .nav-links a, .email-link, etc.) wins
 * automatically. The earlier `body.landing-body a` form had
 * specificity 0,0,1,2 which beat `.btn-primary` (0,0,1,0), painting
 * the "Get the app" button purple-on-purple until :hover shifted
 * the background. */
a {
    color: var(--xp-accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ============================================================
 * Topnav
 * ============================================================ */
.xp-topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--xp-topnav-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--xp-border);
}

.xp-topnav .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--xp-fg);
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
}
.xp-topnav .brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}
.xp-topnav .brand:hover {
    text-decoration: none;
}

.xp-topnav .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}
.xp-topnav .nav-links a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--xp-radius-sm);
    color: var(--xp-muted);
    text-decoration: none;
    font-weight: 500;
    transition: background 120ms, color 120ms;
}
.xp-topnav .nav-links a:hover {
    background: var(--xp-surface);
    color: var(--xp-fg);
    text-decoration: none;
}
.xp-topnav .nav-links a.active {
    background: var(--xp-accent-soft);
    color: var(--xp-accent);
}

.xp-topnav .topnav-right {
    position: relative;
}
.xp-topnav .lang-toggle {
    background: transparent;
    color: var(--xp-fg);
    border: 1px solid var(--xp-border);
    padding: 6px 12px;
    border-radius: var(--xp-radius-sm);
    cursor: pointer;
    font-size: 14px;
}
.xp-topnav .lang-toggle:hover {
    border-color: var(--xp-accent);
}
.xp-topnav .lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    list-style: none;
    padding: 6px 0;
    background: var(--xp-surface);
    border: 1px solid var(--xp-border);
    border-radius: var(--xp-radius-sm);
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.xp-topnav .lang-menu.open {
    display: block;
}
.xp-topnav .lang-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--xp-fg);
    text-decoration: none;
}
.xp-topnav .lang-menu a:hover {
    background: var(--xp-surface-2);
    text-decoration: none;
}
.xp-topnav .lang-menu a.active {
    color: var(--xp-accent);
}

/* ============================================================
 * Main + footer
 * ============================================================ */
.landing-main {
    flex: 1;
    padding: 48px 24px 64px;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
}

.xp-footer {
    border-top: 1px solid var(--xp-border);
    padding: 24px 0;
    background: var(--xp-bg);
}
.xp-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.xp-footer-copy {
    margin: 0;
    color: var(--xp-muted);
    font-size: 13px;
}
.xp-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 18px;
}
.xp-footer-links a {
    color: var(--xp-muted);
    font-size: 13px;
    text-decoration: none;
}
.xp-footer-links a:hover {
    color: var(--xp-fg);
}

/* ============================================================
 * Buttons / chips
 * ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--xp-pill);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 80ms, background 120ms, border-color 120ms;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--xp-accent);
    color: var(--xp-fg);
}
.btn-primary:hover {
    background: var(--xp-accent-2);
    color: var(--xp-fg);
}
.btn-ghost {
    background: transparent;
    color: var(--xp-fg);
    border-color: var(--xp-border);
}
.btn-ghost:hover {
    border-color: var(--xp-accent);
    color: var(--xp-fg);
}

/* ============================================================
 * Hero (home page)
 * ============================================================ */
.xp-hero {
    text-align: center;
    padding: 64px 16px 48px;
}
.xp-hero .hero-logo {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    margin: 0 auto 24px;
    display: block;
    box-shadow: 0 0 60px var(--xp-accent-glow);
}
.xp-hero h1 {
    font-size: 56px;
    line-height: 1.05;
    font-weight: 800;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}
.xp-hero .lede {
    font-size: 18px;
    color: var(--xp-muted);
    max-width: 640px;
    margin: 0 auto 32px;
}
.xp-hero .cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Tagline ribbon — small purple line beneath the hero title. */
.xp-hero .tagline-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 16px;
    border-radius: var(--xp-pill);
    background: var(--xp-accent-soft);
    color: var(--xp-accent);
    font-size: 13px;
    font-weight: 600;
}
.xp-hero .tagline-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--xp-accent);
}

/* ============================================================
 * Feature grid
 * ============================================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 48px 0;
}
.feature-card {
    background: var(--xp-surface);
    border: 1px solid var(--xp-border);
    border-radius: var(--xp-radius-lg);
    padding: 28px;
    transition: border-color 120ms, transform 120ms;
}
.feature-card:hover {
    border-color: var(--xp-accent);
    transform: translateY(-2px);
}
.feature-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--xp-fg);
}
.feature-card p {
    margin: 0;
    color: var(--xp-muted);
    line-height: 1.6;
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--xp-accent-soft);
    color: var(--xp-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

/* ============================================================
 * Download page
 * ============================================================ */
.dl-header {
    text-align: center;
    margin-bottom: 40px;
}
.dl-header h1 {
    font-size: 44px;
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}
.dl-header p {
    font-size: 17px;
    color: var(--xp-muted);
    max-width: 580px;
    margin: 0 auto;
}

.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 880px;
    margin: 0 auto;
}
.dl-card {
    background: var(--xp-surface);
    border: 1px solid var(--xp-border);
    border-radius: var(--xp-radius-xl);
    padding: 32px;
    text-align: center;
    transition: border-color 120ms;
}
.dl-card:hover { border-color: var(--xp-accent); }

.dl-card h3 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 700;
}

.dl-card .qr {
    width: 240px;
    height: 240px;
    margin: 0 auto 24px;
    background: var(--xp-fg);
    border-radius: var(--xp-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dl-card .qr svg {
    width: 100%;
    height: 100%;
    display: block;
}
.dl-card .qr-fallback {
    color: var(--xp-bg);
    font-size: 13px;
    text-align: center;
}

.dl-card .dl-link {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--xp-pill);
    background: var(--xp-accent);
    color: var(--xp-fg);
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
}
.dl-card .dl-link:hover {
    background: var(--xp-accent-2);
    text-decoration: none;
}
.dl-card .dl-note {
    color: var(--xp-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
 * Generic content section
 * ============================================================ */
.xp-section {
    max-width: 760px;
    margin: 48px auto;
    padding: 0 16px;
}
.xp-section h1 {
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}
.xp-section h2 {
    font-size: 24px;
    margin: 32px 0 12px;
}
.xp-section p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--xp-fg);
}
.xp-section .lede {
    color: var(--xp-muted);
    font-size: 18px;
}
.xp-section .contact {
    margin-top: 32px;
    padding: 24px;
    background: var(--xp-surface);
    border: 1px solid var(--xp-border);
    border-radius: var(--xp-radius-lg);
    text-align: center;
}
.xp-section .contact a {
    font-size: 18px;
    font-weight: 600;
}

/* ============================================================
 * iOS-soon page
 * ============================================================ */
.ios-soon {
    max-width: 560px;
    margin: 80px auto;
    text-align: center;
    padding: 0 16px;
}
.ios-soon .badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--xp-pill);
    background: var(--xp-accent-soft);
    color: var(--xp-accent);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}
.ios-soon h1 {
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 16px;
}
.ios-soon p {
    font-size: 17px;
    color: var(--xp-muted);
    margin-bottom: 32px;
}

/* ============================================================
 * Email obfuscation -- "hello<SVG @>xpopup.net"
 *
 * The @ glyph is rendered as an inline SVG (see public/at_icon.html
 * partial) so naive scrapers scanning for \w+@\w+\.\w+ in the
 * rendered HTML never match. The mailto: href keeps the literal @
 * so clicks still open the user's mail client.
 * ============================================================ */
.at-icon {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.15em;
    color: var(--xp-accent);
    margin: 0 1px;
}
.email-link {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--xp-fg);
}
.email-link:hover {
    color: var(--xp-accent);
    text-decoration: none;
}
.email-link .at-icon {
    color: var(--xp-accent);
}

/* ============================================================
 * 404 / notfound
 * ============================================================ */
.notfound {
    max-width: 480px;
    margin: 96px auto;
    text-align: center;
    padding: 0 16px;
}
.notfound h1 {
    font-size: 48px;
    margin: 0 0 16px;
}
.notfound p {
    color: var(--xp-muted);
    margin-bottom: 24px;
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 768px) {
    .xp-topnav {
        padding: 0 16px;
        gap: 12px;
    }
    .xp-topnav .nav-links {
        gap: 2px;
    }
    .xp-topnav .nav-links a {
        padding: 6px 8px;
        font-size: 13px;
    }
    .xp-topnav .brand span {
        display: none;
    }
    .xp-hero h1 { font-size: 38px; }
    .xp-hero .lede { font-size: 16px; }
    .dl-header h1 { font-size: 32px; }
    .dl-card .qr { width: 200px; height: 200px; }
}
