/* ==========================================================================
   LibreWXR site v2 - shared design system
   Dark radar-ops aesthetic. dBZ color ramp as the accent vocabulary.
   Display type: Space Grotesk (self-hosted variable font, OFL - see fonts/).
   Body type: refined system stack. Zero third-party runtime dependencies.
   ========================================================================== */

@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-latin-wght.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    /* Surfaces (theme-color family #0f1117) */
    --lx-bg: #0f1117;
    --lx-bg-raised: #161822;
    --lx-bg-overlay: #1a1c28;
    --lx-bg-code: #12141d;
    --lx-bg-inset: #1e2030;
    --lx-border: #2a2d3a;
    --lx-border-soft: #202331;

    /* Text (AA on --lx-bg and --lx-bg-raised) */
    --lx-text: #eef1f8;
    --lx-text-body: #b6bdcd;
    --lx-text-muted: #9ca3af;
    --lx-text-dim: #8b93a5;

    /* Brand + dBZ ramp accents */
    --lx-accent: #4ea8de;
    --lx-accent-bright: #6abff0;
    --lx-accent-soft: rgba(78, 168, 222, 0.12);
    --lx-accent-line: rgba(78, 168, 222, 0.4);
    --lx-dbz-blue: #4ea8de;
    --lx-dbz-green: #35d435;
    --lx-dbz-yellow: #f5d90a;
    --lx-dbz-orange: #fd9500;
    --lx-dbz-red: #ff5252;
    --lx-dbz-magenta: #e879f9;
    --lx-ramp: linear-gradient(90deg,
        #4ea8de 0%, #35d435 24%, #f5d90a 44%,
        #fd9500 62%, #ff5252 80%, #e879f9 100%);

    /* Type */
    --lx-font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --lx-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --lx-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* Spacing scale */
    --lx-s1: 4px;  --lx-s2: 8px;  --lx-s3: 12px; --lx-s4: 16px;
    --lx-s5: 24px; --lx-s6: 32px; --lx-s7: 48px; --lx-s8: 64px; --lx-s9: 96px;

    /* Shape + elevation */
    --lx-radius-sm: 8px;
    --lx-radius: 12px;
    --lx-radius-lg: 16px;
    --lx-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.25);
    --lx-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.3);
    --lx-glow: 0 0 0 1px rgba(78, 168, 222, 0.25), 0 8px 32px rgba(78, 168, 222, 0.12);

    --lx-maxw: 1160px;
    --lx-header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--lx-header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--lx-font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--lx-text-body);
    background: var(--lx-bg);
    min-height: 100vh;
}

::selection { background: rgba(78, 168, 222, 0.35); color: #fff; }

h1, h2, h3, h4 {
    font-family: var(--lx-font-display);
    color: var(--lx-text);
    line-height: 1.15;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

a { color: var(--lx-accent); text-decoration: none; }
a:hover { color: var(--lx-accent-bright); text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; }

:focus-visible {
    outline: 2px solid var(--lx-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

code {
    font-family: var(--lx-font-mono);
    font-size: 0.86em;
    background: var(--lx-bg-inset);
    border: 1px solid var(--lx-border-soft);
    padding: 1px 7px;
    border-radius: 6px;
    color: #d7dcec;
    word-break: break-word;
}

pre {
    background: var(--lx-bg-code);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: var(--lx-s4) var(--lx-s5);
    overflow-x: auto;
    margin: var(--lx-s4) 0;
    font-size: 14px;
    line-height: 1.7;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 13.5px;
    color: #cdd4e4;
    word-break: normal;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.lx-container {
    max-width: var(--lx-maxw);
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 32px);
}

/* dBZ ramp accent bar */
.ramp-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--lx-ramp);
}

/* ── Header / navigation ───────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: rgba(15, 17, 23, 0.86);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    backdrop-filter: blur(12px) saturate(1.3);
    border-bottom: 1px solid var(--lx-border-soft);
}

.site-header-inner {
    max-width: var(--lx-maxw);
    margin-inline: auto;
    padding: 0 clamp(16px, 4vw, 32px);
    height: var(--lx-header-h);
    display: flex;
    align-items: center;
    gap: var(--lx-s5);
}

.brand {
    display: inline-flex;
    align-items: center;
    font-family: var(--lx-font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lx-text);
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover { color: #fff; text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; margin-right: 10px; }
.brand span { color: var(--lx-accent); }

.header-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.8vw, 22px);
    margin-left: auto;
}

.header-links a {
    color: var(--lx-text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.header-links a:hover { color: var(--lx-text); text-decoration: none; }
.header-links a.active { color: var(--lx-accent); border-bottom-color: var(--lx-accent); }

.header-links a.nav-cta {
    color: var(--lx-text);
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: 999px;
    padding: 7px 16px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.header-links a.nav-cta:hover {
    border-color: var(--lx-accent);
    background: var(--lx-bg-overlay);
    color: #fff;
}

.header-links a.nav-cta svg { width: 16px; height: 16px; }

.menu-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid transparent;
    color: var(--lx-text);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--lx-radius-sm);
    transition: background 0.15s ease;
}

.menu-toggle:hover { background: var(--lx-bg-raised); }
.menu-toggle svg { width: 26px; height: 26px; display: block; }

/* ── What's-new banner ─────────────────────────────────────────────────── */
.ws-banner {
    background: linear-gradient(90deg, rgba(78, 168, 222, 0.16), rgba(78, 168, 222, 0.05) 60%, rgba(232, 121, 249, 0.08));
    border-bottom: 1px solid var(--lx-accent-line);
    padding: 10px 24px;
}

.ws-banner-inner {
    max-width: var(--lx-maxw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.ws-banner-badge {
    flex-shrink: 0;
    background: var(--lx-accent);
    color: #0f1117;
    font-family: var(--lx-font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.ws-banner-text {
    flex: 1 1 320px;
    min-width: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #d4d8e8;
}

.ws-banner-text code { padding: 1px 6px; font-size: 13px; }

.ws-banner-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.ws-banner-link {
    color: var(--lx-accent-bright);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ws-banner-link:hover { text-decoration: underline; }
.ws-banner-link-secondary { color: var(--lx-text-muted); font-weight: 500; }
.ws-banner-link-secondary:hover { color: var(--lx-accent-bright); }

.ws-banner-close {
    flex-shrink: 0;
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--lx-radius-sm);
    color: var(--lx-text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ws-banner-close:hover { background: rgba(78, 168, 222, 0.18); color: var(--lx-text); }

/* ── Buttons, chips, eyebrows ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--lx-font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-primary {
    background: var(--lx-accent);
    color: #0c1017;
    box-shadow: 0 4px 20px rgba(78, 168, 222, 0.3);
}

.btn-primary:hover { background: var(--lx-accent-bright); color: #0c1017; box-shadow: 0 6px 26px rgba(78, 168, 222, 0.42); }

.btn-ghost {
    background: rgba(22, 24, 34, 0.7);
    border-color: var(--lx-border);
    color: var(--lx-text);
}

.btn-ghost:hover { border-color: var(--lx-accent); color: #fff; background: var(--lx-bg-overlay); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--lx-font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--lx-accent);
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: var(--lx-ramp);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: 999px;
    color: var(--lx-text-body);
    font-size: 13px;
    font-weight: 500;
}

.chip strong { color: var(--lx-text); font-weight: 600; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lx-accent); flex-shrink: 0; }

/* ── Sections ──────────────────────────────────────────────────────────── */
.section { padding-block: var(--lx-s8); }
.section + .section { border-top: 1px solid var(--lx-border-soft); }

.section-head { max-width: 760px; margin-bottom: var(--lx-s6); }

.section-head h2 {
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 700;
    margin: 14px 0 12px;
}

.section-head .lead {
    font-size: 17px;
    color: var(--lx-text-muted);
    line-height: 1.65;
}

.section-head .lead a { font-weight: 500; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: var(--lx-s5);
}

/* ── Feature groups (landing) ──────────────────────────────────────────── */
.feature-group {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: var(--lx-s5) var(--lx-s6);
    padding-block: var(--lx-s6);
}

.feature-group + .feature-group { border-top: 1px solid var(--lx-border-soft); }

.feature-group-label { position: sticky; top: calc(var(--lx-header-h) + 24px); align-self: start; }

.feature-group-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lx-radius);
    background: var(--ga-soft);
    border: 1px solid var(--ga-line);
    color: var(--ga);
    margin-bottom: var(--lx-s3);
}

.feature-group-icon svg { width: 23px; height: 23px; }

.feature-group-label h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-group-label p { font-size: 14px; color: var(--lx-text-muted); line-height: 1.55; }

.g-coverage { --ga: #4ea8de; --ga-soft: rgba(78, 168, 222, 0.12); --ga-line: rgba(78, 168, 222, 0.35); }
.g-layers   { --ga: #35d435; --ga-soft: rgba(53, 212, 53, 0.1);  --ga-line: rgba(53, 212, 53, 0.32); }
.g-realtime { --ga: #f5d90a; --ga-soft: rgba(245, 217, 10, 0.09); --ga-line: rgba(245, 217, 10, 0.3); }
.g-ops      { --ga: #fd9500; --ga-soft: rgba(253, 149, 0, 0.1); --ga-line: rgba(253, 149, 0, 0.32); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--lx-s4);
    align-content: start;
}

.feature-card {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--ga, var(--lx-accent));
    opacity: 0.65;
}

.feature-card:hover {
    border-color: var(--ga-line, var(--lx-accent-line));
    transform: translateY(-2px);
    box-shadow: var(--lx-shadow);
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0;
}

.feature-card p { font-size: 14px; color: var(--lx-text-muted); line-height: 1.6; }
.feature-card p a { font-weight: 500; }

/* ── Compatibility matrix ──────────────────────────────────────────────── */
.compat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lx-s4);
}

.compat-panel { padding: var(--lx-s5); }

.compat-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--lx-s4);
}

.compat-panel h3 svg { width: 20px; height: 20px; flex-shrink: 0; }
.compat-dropin h3 { color: var(--lx-accent-bright); }
.compat-adds h3 { color: var(--lx-dbz-green); }

.compat-list { list-style: none; }

.compat-list li {
    display: flex;
    gap: 11px;
    padding: 9px 0;
    font-size: 14.5px;
    line-height: 1.55;
    border-bottom: 1px solid var(--lx-border-soft);
}

.compat-list li:last-child { border-bottom: none; }

.compat-list li svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 4px;
}

.compat-dropin .compat-list li svg { color: var(--lx-accent); }
.compat-adds .compat-list li svg { color: var(--lx-dbz-green); }
.compat-list code { font-size: 12.5px; padding: 0 5px; }

.compat-migrate {
    margin-top: var(--lx-s4);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--lx-s4);
    align-items: center;
}

.compat-migrate pre { margin: 0; }
.compat-migrate .diff-old { color: #ff8f8f; }
.compat-migrate .diff-new { color: #7ee787; }

.compat-note {
    margin-top: var(--lx-s4);
    font-size: 13.5px;
    color: var(--lx-text-dim);
    line-height: 1.6;
}

/* ── Code blocks with chrome ───────────────────────────────────────────── */
.codeblock {
    background: var(--lx-bg-code);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    overflow: hidden;
    margin: var(--lx-s4) 0;
}

.codeblock-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--lx-bg-raised);
    border-bottom: 1px solid var(--lx-border-soft);
}

.codeblock-dots { display: inline-flex; gap: 6px; }
.codeblock-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--lx-border); }
.codeblock-dots i:first-child { background: rgba(255, 82, 82, 0.7); }
.codeblock-dots i:nth-child(2) { background: rgba(245, 217, 10, 0.6); }
.codeblock-dots i:nth-child(3) { background: rgba(53, 212, 53, 0.6); }

.codeblock-title {
    font-family: var(--lx-font-mono);
    font-size: 12px;
    color: var(--lx-text-dim);
    margin-left: 6px;
}

.codeblock pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: none;
}

.copy-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--lx-border);
    border-radius: 6px;
    color: var(--lx-text-muted);
    font-family: var(--lx-font-body);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover { color: var(--lx-text); border-color: var(--lx-accent); }
.copy-btn svg { width: 13px; height: 13px; }

/* ── Coverage maps + data sources ──────────────────────────────────────── */
.map-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lx-s4);
    margin-bottom: var(--lx-s6);
}

.map-figure {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: var(--lx-s3);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.map-figure:hover { border-color: var(--lx-accent-line); box-shadow: var(--lx-shadow); }

.map-figure img {
    display: block;
    width: 100%;
    border-radius: var(--lx-radius-sm);
    background: var(--lx-bg);
}

.map-figure figcaption {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 12px 6px 4px;
    font-size: 13.5px;
    color: var(--lx-text-muted);
}

.map-figure figcaption strong {
    font-family: var(--lx-font-display);
    color: var(--lx-text);
    font-size: 14.5px;
    font-weight: 600;
}

.regional-maps { margin-bottom: var(--lx-s6); }

.regional-maps summary {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    list-style: none;
    font-family: var(--lx-font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--lx-accent);
    padding: 9px 16px;
    border: 1px solid var(--lx-border);
    border-radius: 999px;
    background: var(--lx-bg-raised);
    transition: border-color 0.15s ease;
}

.regional-maps summary::-webkit-details-marker { display: none; }
.regional-maps summary:hover { border-color: var(--lx-accent); }
.regional-maps summary svg { width: 15px; height: 15px; transition: transform 0.18s ease; }
.regional-maps[open] summary svg { transform: rotate(90deg); }
.regional-maps .map-grid { margin-top: var(--lx-s4); margin-bottom: 0; grid-template-columns: repeat(3, 1fr); }

.sources-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lx-s5) var(--lx-s7);
}

.source-group { min-width: 0; }
.source-group.source-wide { grid-column: 1 / -1; }

.source-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: var(--lx-s3);
}

.source-group h3::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--sg, var(--lx-accent));
    flex-shrink: 0;
}

.source-list { list-style: none; }

.source-list li {
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--lx-text-muted);
    border-bottom: 1px solid var(--lx-border-soft);
    break-inside: avoid;
}

.source-list li:last-child { border-bottom: none; }
.source-list li strong, .source-list li a { font-weight: 600; }
.source-list li a { color: var(--lx-accent); }
.source-list code { font-size: 12px; padding: 0 5px; }

.source-group .source-cols { columns: 2; column-gap: var(--lx-s6); }

.sources-footnote {
    margin-top: var(--lx-s5);
    font-size: 14px;
    color: var(--lx-text-dim);
}

/* ── Licensing / open source panels ────────────────────────────────────── */
.license-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lx-s4);
}

.license-panel h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.license-panel h3 .chip { font-size: 11.5px; padding: 3px 10px; }
.license-panel p { font-size: 14.5px; line-height: 1.65; color: var(--lx-text-muted); }
.license-panel p + p { margin-top: 10px; }
.license-panel p strong { color: var(--lx-text-body); }

.cta-band {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(600px 300px at 85% 50%, rgba(78, 168, 222, 0.12), transparent 70%),
        var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius-lg);
    padding: clamp(28px, 5vw, 56px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lx-s5);
    flex-wrap: wrap;
}

.cta-band::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--lx-ramp);
}

.cta-band h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.cta-band p { font-size: 15px; color: var(--lx-text-muted); max-width: 560px; }
.cta-band .btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Showcase ──────────────────────────────────────────────────────────── */
.showcase-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--lx-s4);
}

.showcase-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: 999px;
    color: #d4d8e8;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.15s ease, background 0.18s ease, color 0.18s ease;
}

.showcase-chip:hover {
    border-color: var(--lx-accent);
    background: var(--lx-bg-overlay);
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.showcase-cta { margin-top: var(--lx-s4); font-size: 15px; color: var(--lx-text-muted); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--lx-border-soft);
    background: #0c0e13;
    margin-top: var(--lx-s8);
}

.site-footer-grid {
    max-width: var(--lx-maxw);
    margin-inline: auto;
    padding: var(--lx-s7) clamp(16px, 4vw, 32px) var(--lx-s6);
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: var(--lx-s6);
}

.site-footer-brand p {
    margin-top: var(--lx-s3);
    font-size: 14px;
    color: var(--lx-text-dim);
    max-width: 300px;
    line-height: 1.6;
}

.site-footer h4 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lx-text-dim);
    margin-bottom: var(--lx-s3);
}

.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 9px; }

.site-footer ul a {
    color: var(--lx-text-muted);
    font-size: 14px;
    text-decoration: none;
}

.site-footer ul a:hover { color: var(--lx-accent-bright); }

.site-footer-bottom {
    border-top: 1px solid var(--lx-border-soft);
    padding: var(--lx-s4) clamp(16px, 4vw, 32px);
    max-width: var(--lx-maxw);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lx-s3);
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--lx-text-dim);
}

.site-footer-bottom a { color: var(--lx-accent); }

/* ── Page shells (docs / support / terms / tools / examples) ───────────── */
.page-head { padding: var(--lx-s7) 0 var(--lx-s5); }
.page-head h1 { font-size: clamp(30px, 4.5vw, 44px); font-weight: 700; margin: 14px 0 10px; }
.page-head .subtitle { font-size: 17px; color: var(--lx-text-muted); max-width: 720px; }
.terms-updated { color: var(--lx-text-dim); font-size: 14px; margin-bottom: var(--lx-s5); }

.page-body { padding-bottom: var(--lx-s8); }
.page-narrow { max-width: 860px; margin-inline: auto; }
.page-wide { max-width: 1100px; margin-inline: auto; }

.prose h1 {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    margin-bottom: 10px;
}

.prose h2 {
    font-size: 24px;
    font-weight: 700;
    margin: var(--lx-s7) 0 var(--lx-s4);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--lx-border-soft);
}

.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; font-weight: 600; margin: var(--lx-s6) 0 var(--lx-s3); }
.prose h4 { font-size: 16px; font-weight: 600; margin: var(--lx-s5) 0 var(--lx-s2); }
.prose p { margin-bottom: var(--lx-s4); font-size: 15.5px; }
.prose ul, .prose ol { margin: 0 0 var(--lx-s4); padding-left: 24px; }
.prose li { margin-bottom: 6px; font-size: 15.5px; }
.prose li::marker { color: var(--lx-accent); }
.prose strong { color: var(--lx-text-body); }
.prose hr { border: none; border-top: 1px solid var(--lx-border-soft); margin: var(--lx-s7) 0; }
.prose img { border-radius: var(--lx-radius-sm); margin: var(--lx-s4) 0; display: block; }
.prose blockquote {
    border-left: 3px solid var(--lx-accent);
    background: var(--lx-bg-raised);
    border-radius: 0 var(--lx-radius-sm) var(--lx-radius-sm) 0;
    padding: var(--lx-s3) var(--lx-s4);
    margin: 0 0 var(--lx-s4);
    color: var(--lx-text-muted);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--lx-s4) 0 var(--lx-s5);
    font-size: 14px;
}

.prose th {
    text-align: left;
    padding: 10px 12px;
    background: var(--lx-bg-raised);
    color: var(--lx-text);
    font-weight: 600;
    border-bottom: 2px solid var(--lx-border);
}

.prose td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--lx-border-soft);
    color: var(--lx-text-muted);
    vertical-align: top;
}

.prose tr:hover td { background: rgba(78, 168, 222, 0.04); }
.prose td code { font-size: 13px; padding: 1px 5px; }

.prose table.prop-table { width: auto; margin: 8px 0 16px; }
.prose table.prop-table td { padding: 4px 12px 4px 0; border: none; }
.prose table.prop-table td:first-child { color: var(--lx-text-dim); font-size: 13px; white-space: nowrap; }
.prose table.prop-table td:last-child { color: var(--lx-text); }

/* ── Docs layout + sidebar ─────────────────────────────────────────────── */
.doc-layout {
    display: flex;
    max-width: 1280px;
    margin-inline: auto;
    min-height: calc(100vh - var(--lx-header-h) - 140px);
}

.doc-sidebar {
    width: 264px;
    flex-shrink: 0;
    border-right: 1px solid var(--lx-border-soft);
    padding: var(--lx-s5) var(--lx-s4);
    position: sticky;
    top: var(--lx-header-h);
    height: calc(100vh - var(--lx-header-h));
    overflow-y: auto;
}

.doc-sidebar h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--lx-text-dim);
    margin-bottom: var(--lx-s3);
    padding: 0 8px;
}

.doc-sidebar ul { list-style: none; margin-bottom: var(--lx-s5); }

.doc-sidebar ul li a {
    display: block;
    padding: 6px 9px;
    font-size: 13.5px;
    color: var(--lx-text-muted);
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, background 0.15s ease;
}

.doc-sidebar ul li a:hover { color: var(--lx-text); background: var(--lx-accent-soft); text-decoration: none; }
.doc-sidebar ul li a.active { color: var(--lx-accent); background: var(--lx-accent-soft); border-left-color: var(--lx-accent); }

.doc-content { flex: 1; min-width: 0; padding: var(--lx-s6) var(--lx-s7) var(--lx-s8); }
.doc-content .subtitle { font-size: 16px; color: var(--lx-text-muted); margin-bottom: var(--lx-s6); }

.doc-loading { text-align: center; padding: 80px 24px; color: var(--lx-text-dim); font-size: 16px; }

.doc-loading .spinner {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid var(--lx-border);
    border-top-color: var(--lx-accent);
    border-radius: 50%;
    animation: lx-spin 0.8s linear infinite;
    margin-bottom: var(--lx-s4);
}

@keyframes lx-spin { to { transform: rotate(360deg); } }

.doc-error { text-align: center; padding: 80px 24px; color: #ff8f8f; font-size: 16px; }
.doc-error a { color: var(--lx-accent); }

/* ── Doc / tool index cards ────────────────────────────────────────────── */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--lx-s4);
    margin-top: var(--lx-s5);
}

.doc-card {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: var(--lx-s5);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.doc-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--lx-ramp);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.doc-card:hover {
    border-color: var(--lx-accent-line);
    background: var(--lx-bg-overlay);
    transform: translateY(-2px);
    box-shadow: var(--lx-shadow);
    text-decoration: none;
}

.doc-card:hover::before { opacity: 1; }

.doc-card-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--lx-accent-soft);
    border: 1px solid var(--lx-accent-line);
    color: var(--lx-accent);
}

.doc-card-icon svg { width: 19px; height: 19px; }

.doc-card h3 { font-size: 17px; font-weight: 600; color: var(--lx-text); }
.doc-card p { font-size: 13.5px; color: var(--lx-text-muted); line-height: 1.6; margin: 0; }
.doc-card p code { font-size: 12px; padding: 0 5px; }

/* ── Example cards ─────────────────────────────────────────────────────── */
.example-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--lx-s5);
    margin-top: var(--lx-s6);
}

.example-card {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius-lg);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.example-card:hover {
    border-color: var(--lx-accent);
    transform: translateY(-3px);
    box-shadow: var(--lx-shadow-lg);
    text-decoration: none;
}

.card-preview {
    height: 180px;
    background:
        repeating-radial-gradient(circle at 50% 120%, transparent 0 34px, rgba(78, 168, 222, 0.09) 34px 36px),
        radial-gradient(420px 220px at 50% 130%, rgba(78, 168, 222, 0.16), transparent 70%),
        var(--lx-bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--lx-border);
    position: relative;
    overflow: hidden;
}

.card-preview .lib-badge {
    font-family: var(--lx-font-display);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.card-preview .lib-badge span { color: var(--lx-accent); }

.card-preview .lib-version {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-family: var(--lx-font-mono);
    font-size: 12px;
    color: var(--lx-text-dim);
}

.card-body { padding: var(--lx-s5); flex: 1; }
.card-body h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.card-body p { font-size: 14px; color: var(--lx-text-muted); line-height: 1.6; margin-bottom: var(--lx-s4); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--lx-accent-soft);
    color: var(--lx-accent-bright);
    border: 1px solid rgba(78, 168, 222, 0.22);
}

.card-footer {
    padding: var(--lx-s4) var(--lx-s5);
    border-top: 1px solid var(--lx-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-footer .open-label {
    font-family: var(--lx-font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--lx-accent);
}

.card-footer .arrow { color: var(--lx-accent); font-size: 18px; transition: transform 0.18s ease; }
.example-card:hover .card-footer .arrow { transform: translateX(4px); }

.features-section { margin-top: var(--lx-s7); }
.features-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--lx-s4);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--lx-border-soft);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 4px var(--lx-s5);
}

.feature-item {
    font-size: 14px;
    color: var(--lx-text-body);
    padding: 8px 0 8px 22px;
    position: relative;
    line-height: 1.55;
}

.feature-item::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 15px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--lx-ramp);
    background-size: 60px 8px;
}

.feature-item a { font-weight: 500; }

.note-box {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-left: 3px solid var(--lx-accent);
    border-radius: var(--lx-radius-sm);
    padding: var(--lx-s4) var(--lx-s5);
    margin-top: var(--lx-s6);
    font-size: 14px;
    color: var(--lx-text-muted);
    line-height: 1.65;
}

.note-box strong { color: var(--lx-text); }
.note-box code { font-size: 13px; }

/* ── Support page ──────────────────────────────────────────────────────── */
.support-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--lx-s4); }

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border-radius: 10px;
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    color: #d4d8e8 !important;
    font-family: var(--lx-font-display);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.support-btn:hover { transform: translateY(-2px); box-shadow: var(--lx-shadow); text-decoration: none !important; }
.support-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.support-btn.kofi:hover { border-color: #FF5E5B; }
.support-btn.kofi svg { color: #FF5E5B; }
.support-btn.paypal:hover { border-color: #0070BA; }
.support-btn.paypal svg { color: #4ea8de; }
.support-btn.liberapay:hover { border-color: #f6c915; }
.support-btn.liberapay svg { color: #f6c915; }

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--lx-s4);
    margin-top: var(--lx-s4);
}

.crypto-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: var(--lx-s5) var(--lx-s4);
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.crypto-card:hover { box-shadow: var(--lx-shadow); }
.crypto-card.btc:hover { border-color: rgba(247, 147, 26, 0.5); }
.crypto-card.eth:hover { border-color: rgba(98, 126, 234, 0.55); }
.crypto-card.sol:hover { border-color: rgba(153, 69, 255, 0.5); }

.crypto-qr {
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    line-height: 0;
}

.crypto-qr img { display: block; width: 140px; height: 140px; }

.crypto-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--lx-text);
    font-family: var(--lx-font-display);
    font-size: 15px;
    font-weight: 600;
}

.crypto-label .crypto-icon { width: 20px; height: 20px; flex-shrink: 0; }

.crypto-address {
    width: 100%;
    font-family: var(--lx-font-mono);
    font-size: 12px;
    color: #d4d8e8;
    background: var(--lx-bg-inset);
    border: 1px solid var(--lx-border-soft);
    padding: 8px 10px;
    border-radius: 6px;
    word-break: break-all;
    user-select: all;
    text-align: center;
    line-height: 1.45;
}

.crypto-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--lx-bg-inset);
    border: 1px solid var(--lx-border);
    color: #d4d8e8;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.crypto-card.btc .crypto-copy:hover { border-color: #F7931A; }
.crypto-card.eth .crypto-copy:hover { border-color: #627EEA; }
.crypto-card.sol .crypto-copy:hover { border-color: #9945FF; }
.crypto-copy svg { width: 14px; height: 14px; }

.gh-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: var(--lx-s4) 0 var(--lx-s5); }
.gh-badges a { display: inline-flex; line-height: 0; text-decoration: none; transition: transform 0.15s ease; }
.gh-badges a:hover { transform: translateY(-1px); }
.gh-badges img { display: block; height: 28px; width: auto; }

.supporter-list {
    list-style: none;
    padding: 0;
    margin: var(--lx-s4) 0 var(--lx-s5);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.supporter-list li {
    background: var(--lx-bg-raised);
    border: 1px solid var(--lx-border);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--lx-text-body);
    transition: border-color 0.18s ease;
}

.supporter-list li a { color: var(--lx-accent); font-weight: 500; }
.supporter-list li:hover { border-color: var(--lx-accent-line); }

/* ── 404 ───────────────────────────────────────────────────────────────── */
.error-hero {
    position: relative;
    text-align: center;
    padding: var(--lx-s9) 24px;
    overflow: hidden;
}

.error-hero .rings {
    position: absolute;
    inset: 0;
    background: repeating-radial-gradient(circle at 50% 42%, transparent 0 58px, rgba(78, 168, 222, 0.07) 58px 60px);
    pointer-events: none;
}

.error-hero .code {
    font-family: var(--lx-font-display);
    font-size: clamp(72px, 14vw, 128px);
    font-weight: 700;
    line-height: 1;
    background: var(--lx-ramp);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

.error-hero h1 { font-size: clamp(22px, 4vw, 32px); margin: var(--lx-s4) 0 var(--lx-s3); position: relative; }
.error-hero p { color: var(--lx-text-muted); max-width: 520px; margin: 0 auto var(--lx-s5); position: relative; }
.error-hero .btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
    .feature-group { grid-template-columns: 1fr; gap: var(--lx-s4); }
    .feature-group-label { position: static; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; }
    .feature-group-icon { grid-row: span 2; margin-bottom: 0; }
    .sources-grid { grid-template-columns: 1fr; }
    .source-group .source-cols { columns: 1; }
    .regional-maps .map-grid { grid-template-columns: 1fr 1fr; }
    .site-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .compat-grid, .map-grid, .license-grid { grid-template-columns: 1fr; }
    .compat-migrate { grid-template-columns: 1fr; }
    .doc-layout { flex-direction: column; }
    .doc-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--lx-border-soft);
        padding: var(--lx-s4) clamp(16px, 4vw, 32px);
    }
    .doc-sidebar ul { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--lx-s3); }
    .doc-content { padding: var(--lx-s5) clamp(16px, 4vw, 32px) var(--lx-s7); }
    .prose table { display: block; overflow-x: auto; white-space: nowrap; }
    .prose table.prop-table { display: table; white-space: normal; }
}

@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; }
    .header-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(15, 17, 23, 0.98);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--lx-border);
        padding: 4px 0;
        /* Leaflet controls use z-index 1000; the dropdown must clear the map. */
        z-index: 1100;
        box-shadow: var(--lx-shadow-lg);
    }
    .header-links.open { display: flex; }
    .header-links a { padding: 14px 24px; font-size: 15px; border-top: 1px solid var(--lx-border-soft); border-bottom: none; }
    .header-links a:first-child { border-top: none; }
    .header-links a.active { border-bottom: none; background: var(--lx-accent-soft); }
    .header-links a.nav-cta { margin: 10px 24px; justify-content: center; border-top: 1px solid var(--lx-border); }
    .crypto-grid { grid-template-columns: 1fr; }
    .section { padding-block: var(--lx-s7); }
}

@media (max-width: 560px) {
    .regional-maps .map-grid { grid-template-columns: 1fr; }
    .site-footer-grid { grid-template-columns: 1fr; gap: var(--lx-s5); }
    .ws-banner { padding: 10px 16px; }
    .ws-banner-text { font-size: 13px; }
    .ws-banner-link { font-size: 13px; }
    .support-buttons { flex-direction: column; align-items: stretch; }
    .support-btn { justify-content: center; }
    .cta-band .btn-row { width: 100%; }
    .cta-band .btn { flex: 1; }
    pre { padding: var(--lx-s3) var(--lx-s4); }
    pre code { font-size: 12.5px; }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .btn:hover, .feature-card:hover, .doc-card:hover, .example-card:hover,
    .showcase-chip:hover, .support-btn:hover { transform: none; }
}
