/* ==========================================================
   PixelMusic — extras.css (loads AFTER style.css)
   Adds: contrast fixes, header-safe anchors, hero visual,
   download center, trust grid, grouped gallery, FAQ, support,
   lightbox navigation. Keeps the peach/cream skeuomorphic style.
   ========================================================== */

:root {
    /* Slightly darker secondary text for better contrast on #FFD6C9 */
    --text-secondary: #4a2a1b;
    --text-muted: #6b4130;
}

/* ---------- Header-safe anchors (fixes content hidden under sticky nav) ---------- */
[id] { scroll-margin-top: 96px; }

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 3000;
    padding: 10px 18px;
    border-radius: var(--pill-radius);
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Mobile CTA button contrast fix in light theme ---------- */
.mobile-nav a.btn-primary,
.mobile-nav .btn-primary {
    color: #ffffff !important;
}

/* ---------- Hero: two-column with phone ---------- */
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 40px;
    padding: 36px 0 70px;
}
.hero-grid .hero { text-align: left; padding: 0; }
.hero-grid .hero-desc { margin-left: 0; margin-right: 0; }
.hero-grid .hero-actions { justify-content: flex-start; margin-bottom: 28px; }
.hero-grid h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); }

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
}
.chip-row li {
    padding: 8px 16px;
    border-radius: var(--pill-radius);
    background: var(--well-bg);
    box-shadow: var(--well-inset);
    color: var(--accent-on-soft);
    font-size: 0.85rem;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-visual { display: flex; justify-content: center; }
.hero-phone {
    flex: 0 0 auto;
    width: min(270px, 70vw);
    cursor: default;
    transform: rotate(3deg);
}
.hero-phone:hover,
.hero-phone:nth-child(even):hover { transform: rotate(3deg) translateY(-6px); }

/* ---------- Download center ---------- */
.download-section { margin-bottom: 100px; }

.download-card {
    background: var(--raised-bg);
    border: 1px solid #fff;
    border-radius: var(--card-radius-lg);
    padding: 34px;
    box-shadow: var(--raised-inset), var(--shadow-md);
}
.release-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.release-version {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.release-meta { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }

.release-assets { display: grid; gap: 14px; margin-bottom: 22px; }
.asset-row {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 22px;
    background: var(--well-bg);
    box-shadow: var(--well-inset);
}
.asset-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.asset-name { font-weight: 800; word-break: break-all; }
.asset-size { color: var(--text-muted); font-size: 0.88rem; font-weight: 700; }
.hash {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.78rem;
    color: var(--accent-on-soft);
    word-break: break-all;
}
.hash-label { font-weight: 800; font-size: 0.8rem; color: var(--text-secondary); }

.release-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.fact {
    padding: 14px 18px;
    border-radius: 20px;
    background: var(--raised-bg);
    border: 1px solid #fff;
    box-shadow: var(--raised-inset), 0 2px 0 #e6bbaa;
}
.fact dt { font-size: 0.78rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fact dd { font-weight: 700; word-break: break-word; }

.whatsnew h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; margin-bottom: 8px; }
.whatsnew ul { padding-left: 22px; margin-bottom: 12px; color: var(--text-secondary); }
.whatsnew li { margin-bottom: 4px; }
.whatsnew li::marker { color: var(--accent); }

.release-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.verify {
    margin-top: 26px;
    border-radius: 22px;
    background: var(--well-bg);
    box-shadow: var(--well-inset);
    padding: 6px 20px;
}
.verify summary { cursor: pointer; font-weight: 800; padding: 12px 0; }
.verify p, .verify li { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 8px; }
.verify pre {
    overflow-x: auto;
    padding: 12px 14px;
    margin: 6px 0 14px;
    border-radius: 14px;
    background: #2b1309;
    color: #ffe9de;
    font-size: 0.8rem;
}

/* ---------- Trust ---------- */
.trust-section { margin-bottom: 100px; }
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}
.trust-item {
    padding: 22px;
    border-radius: 28px;
    background: var(--raised-bg);
    border: 1px solid #fff;
    box-shadow: var(--raised-inset), var(--shadow-sm);
}
.trust-item h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; margin-bottom: 6px; }
.trust-item p { color: var(--text-secondary); font-size: 0.92rem; }
.trust-item a, .legal-card a, .faq a { color: var(--accent); font-weight: 700; }

/* ---------- Grouped gallery ---------- */
.gallery-group { margin-bottom: 8px; }
.gallery-group h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    margin: 18px 10px 0;
    color: var(--accent-on-soft);
    text-shadow: 0 1px 0 #fff;
}
.gallery-group .showcase-scroll { padding-top: 14px; padding-bottom: 20px; }
.device-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* ---------- Lightbox nav ---------- */
.lightbox { flex-direction: column; gap: 14px; }
.lightbox-content { transition: transform 0.3s var(--ease); cursor: zoom-in; }
.lightbox-content.zoomed { transform: scale(1.8); cursor: zoom-out; }
.lightbox-caption {
    color: #ffe9de;
    font-weight: 700;
    text-align: center;
    font-size: 0.95rem;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 1px solid #fff;
    border-radius: 18px;
    background: var(--raised-bg);
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--raised-inset), 0 3px 0 #cc9d86;
}
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-nav:active { box-shadow: var(--well-inset); }

/* ---------- FAQ ---------- */
.faq-section { margin-bottom: 100px; }
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details {
    border-radius: 24px;
    background: var(--raised-bg);
    border: 1px solid #fff;
    box-shadow: var(--raised-inset), var(--shadow-sm);
    padding: 4px 22px;
}
.faq summary { cursor: pointer; font-weight: 800; padding: 16px 0; }
.faq details[open] summary { color: var(--accent); }
.faq p, .faq li { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 12px; }
.faq ol, .faq ul { padding-left: 22px; }

/* ---------- Support ---------- */
.support-section { margin-bottom: 100px; }
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.support-card {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    padding: 24px;
    border-radius: 28px;
    background: var(--raised-bg);
    border: 1px solid #fff;
    box-shadow: var(--raised-inset), var(--shadow-md);
    transition: var(--transition-spring);
}
.support-card:hover { transform: translateY(-5px); box-shadow: var(--raised-inset), var(--shadow-lg); }
.support-card h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; margin-bottom: 6px; }
.support-card p { color: var(--text-secondary); font-size: 0.92rem; }

.policy-meta { color: var(--text-muted); font-weight: 700; font-size: 0.9rem; margin-bottom: 14px; }
.noscript-note { text-align: center; color: var(--text-secondary); padding: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; padding-bottom: 50px; }
    .hero-grid .hero { text-align: center; }
    .hero-grid .hero-actions { justify-content: center; }
    .chip-row { justify-content: center; }
    .hero-grid .hero-desc { margin-left: auto; margin-right: auto; }
}
@media (max-width: 800px) {
    .download-card { padding: 22px 18px; }
    .features-grid, .download-section, .faq-section, .support-section, .trust-section { margin-bottom: 64px; }
    .showcase-container { margin-bottom: 56px; }
    .section-header { margin-bottom: 30px; }
    .legal-card h2 { margin-top: 0; }
    .lightbox-nav { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-content, .skip-link { transition: none !important; }
}

/* ==========================================================
   Automatic Dark Theme (Phone or Browser in Dark Mode)
   - Pure black background (#000000)
   - Sleek B/W (Black and White / Monochrome) aesthetic
   - Vibrant red link accent (#ff5252)
   - Light theme remains completely untouched
   ========================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Pure black background */
        --bg: #000000;
        --surface: #111113;
        --surface-hover: #1c1c1f;
        --surface-subtle: #161618;
        --border: #242428;
        --border-hover: #3f3f46;

        /* High-contrast B/W typography */
        --text-primary: #ffffff;
        --text-secondary: #a1a1aa;
        --text-muted: #71717a;

        /* Monochrome accent palette with Red link accent */
        --accent: #ffffff;
        --accent-hover: #e4e4e7;
        --accent-deep: #27272a;
        --accent-soft: #18181b;
        --accent-on-soft: #ffffff;
        --accent-glow: rgba(255, 255, 255, 0.15);

        --link: #ff5252;
        --link-hover: #ff7875;

        --tertiary: #18181b;
        --tertiary-deep: #121214;
        --secondary-soft: #18181b;

        --bezel: #0a0a0c;
        --bezel-hi: #1f1f23;

        --hi: rgba(255, 255, 255, 0.1);
        --lo: rgba(0, 0, 0, 0.8);

        --shadow-sm: 0 2px 0 #000000, 0 6px 12px rgba(0, 0, 0, 0.7);
        --shadow-md: 0 3px 0 #000000, 0 14px 24px -4px rgba(0, 0, 0, 0.85);
        --shadow-lg: 0 4px 0 #000000, 0 24px 36px -6px rgba(0, 0, 0, 0.95);

        --raised-bg: linear-gradient(180deg, #151518 0%, #0e0e10 100%);
        --raised-inset: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
        --well-bg: linear-gradient(180deg, #09090b 0%, #050507 100%);
        --well-inset: inset 0 2px 5px rgba(0, 0, 0, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    }

    body {
        background-color: #000000;
        color: var(--text-primary);
        background-image:
            radial-gradient(60% 50% at 8% 0%, rgba(255, 255, 255, 0.04) 0%, transparent 70%),
            radial-gradient(50% 45% at 100% 100%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    }

    body::before {
        opacity: 0.02;
        mix-blend-mode: screen;
    }

    /* ---------- Navigation ---------- */
    .navbar {
        background: rgba(10, 10, 12, 0.85);
        border: 1px solid #242428;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.8);
    }
    .brand {
        text-shadow: none;
        color: #ffffff;
    }
    .brand-logo {
        box-shadow: 0 2px 0 #18181b, 0 6px 12px rgba(0, 0, 0, 0.6);
    }
    .nav-links a {
        color: var(--text-secondary);
    }
    .nav-links a:hover {
        color: #ffffff;
        background: #18181b;
        box-shadow: none;
    }
    .menu-toggle {
        background: #141416;
        border: 1px solid #27272a;
        color: #ffffff;
        box-shadow: var(--raised-inset);
    }
    .mobile-nav {
        background: #0f0f11;
        border: 1px solid #27272a;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.95);
    }
    .mobile-nav a {
        color: var(--text-primary);
    }

    /* ---------- Buttons (B/W High Contrast) ---------- */
    .btn-primary,
    a.btn-primary,
    .mobile-nav a.btn-primary,
    .mobile-nav .btn-primary,
    #relPrimary {
        background: linear-gradient(180deg, #ffffff 0%, #eeeeee 100%) !important;
        color: #000000 !important;
        text-shadow: none !important;
        box-shadow:
            inset 0 1.5px 0 rgba(255, 255, 255, 0.8),
            inset 0 -2px 0 rgba(0, 0, 0, 0.15),
            0 4px 0 #333333,
            0 10px 20px rgba(255, 255, 255, 0.12);
    }
    .btn-primary:hover,
    a.btn-primary:hover,
    .mobile-nav a.btn-primary:hover,
    .mobile-nav .btn-primary:hover,
    #relPrimary:hover {
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow:
            inset 0 1.5px 0 rgba(255, 255, 255, 0.9),
            inset 0 -2px 0 rgba(0, 0, 0, 0.15),
            0 6px 0 #333333,
            0 14px 26px rgba(255, 255, 255, 0.18);
    }
    .btn-primary:active {
        box-shadow:
            inset 0 3px 6px rgba(0, 0, 0, 0.25),
            0 0 0 #333333;
    }
    .btn-secondary {
        background: #151518;
        color: #ffffff;
        text-shadow: none;
        border: 1px solid #2e2e34;
        box-shadow: var(--raised-inset), 0 3px 0 #000000;
    }
    .btn-secondary:hover {
        background: #1e1e22;
        color: #ffffff;
        border-color: #4a4a52;
        box-shadow: var(--raised-inset), 0 4px 0 #000000;
    }
    .btn-secondary:active {
        background: #0d0d0f;
    }

    /* ---------- Typography & Headers ---------- */
    .hero h1,
    .showcase-header h2,
    .section-header h2,
    .feature-card h3 {
        text-shadow: none;
        color: #ffffff;
    }
    .hero-desc,
    .section-header p,
    .showcase-header p {
        text-shadow: none;
        color: var(--text-secondary);
    }

    /* ---------- Hero ---------- */
    .hero-pill {
        background: #111114;
        color: #e4e4e7;
        box-shadow: var(--well-inset);
        text-shadow: none;
        border: 1px solid #27272a;
    }
    .hero-pill svg {
        background: #27272a;
        color: #ffffff;
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
    }
    .chip-row li {
        background: #111114;
        color: #d4d4d8;
        box-shadow: var(--well-inset);
        text-shadow: none;
        border: 1px solid #242428;
    }

    /* ---------- Cards & Containers ---------- */
    .feature-card,
    .download-card,
    .trust-item,
    .faq details,
    .support-card {
        background: var(--raised-bg);
        border: 1px solid #242428;
        box-shadow: var(--raised-inset), var(--shadow-md);
    }
    .feature-card:hover,
    .support-card:hover {
        border-color: #3f3f46;
        transform: translateY(-4px);
    }
    .feature-icon {
        background: #18181b;
        color: #ffffff;
        border: 1px solid #2e2e34;
        box-shadow: var(--well-inset);
    }
    .feature-card:hover .feature-icon {
        background: #ffffff;
        color: #000000;
        box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.8), 0 3px 0 #27272a;
    }
    .feature-icon svg {
        filter: none;
    }
    .feature-card:hover .feature-icon svg {
        filter: none;
    }

    /* ---------- Gallery ---------- */
    .gallery-group h3 {
        color: #ffffff;
        text-shadow: none;
    }
    .showcase-scroll::-webkit-scrollbar-thumb {
        background: #3f3f46;
    }

    /* ---------- Download center & Assets ---------- */
    .asset-row {
        background: #09090b;
        border: 1px solid #1f1f23;
    }
    .asset-size {
        color: var(--text-muted);
    }
    .hash {
        color: #a1a1aa;
    }
    .hash-label {
        color: #71717a;
    }
    .fact {
        background: var(--raised-bg);
        border: 1px solid #242428;
        box-shadow: var(--raised-inset), 0 2px 0 #000000;
    }
    .verify {
        background: #09090b;
        border: 1px solid #1f1f23;
    }
    .verify pre {
        background: #000000;
        color: #e4e4e7;
        border: 1px solid #27272a;
    }

    /* ---------- Legal / Policies ---------- */
    .legal-tab-nav {
        background: #09090b;
        border: 1px solid #242428;
    }
    .tab-btn {
        background: #141416;
        border: 1px solid #242428;
        color: var(--text-secondary);
        text-shadow: none;
        box-shadow: var(--raised-inset), 0 2px 0 #000000;
    }
    .tab-btn:hover {
        color: #ffffff;
        border-color: #3f3f46;
    }
    .tab-btn.active {
        background: #ffffff;
        color: #000000;
        border-color: #ffffff;
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
    }
    .legal-card {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 90px),
            linear-gradient(180deg, #121215, #0a0a0c);
        border: 1px solid #242428;
        border-top: 5px solid #ffffff;
    }
    .legal-card code {
        background: #16161a;
        color: #e4e4e7;
        border: 1px solid #27272a;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
    }
    .callout {
        background: #0d0d0f;
        border: 1px solid #242428;
    }
    .callout::before {
        background: #ff5252;
        box-shadow: 0 0 10px rgba(255, 82, 82, 0.6);
    }
    .callout p {
        color: #e4e4e7;
    }

    /* ---------- Links (Red Accent) ---------- */
    a,
    .asset-name,
    .callout a,
    .trust-item a,
    .legal-card a,
    .faq a,
    .faq details[open] summary,
    #trustRelease a,
    #relChangelog {
        color: #ff5252;
    }
    a:hover,
    .asset-name:hover,
    .callout a:hover,
    .trust-item a:hover,
    .legal-card a:hover,
    .faq a:hover,
    #trustRelease a:hover,
    #relChangelog:hover {
        color: #ff7875;
        text-decoration: underline;
    }

    /* ---------- Lightbox ---------- */
    .lightbox {
        background: rgba(0, 0, 0, 0.95);
    }
    .lightbox-nav,
    .lightbox-close {
        background: #151518;
        border: 1px solid #2e2e34;
        color: #ffffff;
        box-shadow: var(--raised-inset), 0 3px 0 #000000;
    }
    .lightbox-nav:hover,
    .lightbox-close:hover {
        background: #222227;
        border-color: #52525b;
    }
    .lightbox-caption {
        color: #d4d4d8;
    }

    /* ---------- Footer ---------- */
    footer {
        background: #0a0a0c;
        border: 1px solid #1f1f23;
    }
    .footer-brand {
        text-shadow: none;
        color: #ffffff;
    }
    .footer-links a {
        color: var(--text-secondary);
        text-decoration: none;
    }
    .footer-links a:hover {
        color: #ffffff;
        background: #18181b;
        box-shadow: none;
        text-decoration: none;
    }
    .footer-copy {
        text-shadow: none;
        color: var(--text-muted);
    }
}
