/* Netquirk Monitoring — public site stylesheet
 *
 * Dark by default; light mode honours @media (prefers-color-scheme: light)
 * and may be overridden by `data-theme="light"` on <html>. No utility
 * classes — every class is a named component so a reviewer can find a
 * colour/space decision by its role (e.g. .nq-card) instead of grepping
 * hundreds of utility tokens.
 *
 * The OIDC-gated dashboard still ships its own stylesheet via
 * `dashboard.html`; this file is intentionally scoped to the
 * pre-auth / public surfaces (landing, status, 404).
 */

:root {
    --nq-bg: #0b1220;
    --nq-surface: #111a2e;
    --nq-surface-2: #16213a;
    --nq-border: #1f2c47;
    --nq-border-strong: #2c3d61;
    --nq-fg: #e2e8f0;
    --nq-fg-muted: #94a3b8;
    --nq-fg-subtle: #64748b;
    --nq-accent: #2563eb;
    --nq-accent-hover: #1d4ed8;
    --nq-accent-fg: #ffffff;
    --nq-success: #16a34a;
    --nq-warning: #d97706;
    --nq-danger: #b91c1c;
    --nq-link: #60a5fa;
    --nq-radius: 8px;
    --nq-radius-lg: 12px;
    --nq-radius-pill: 9999px;
    --nq-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    --nq-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
    --nq-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --nq-top-h: 56px;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --nq-bg: #ffffff;
        --nq-surface: #f8fafc;
        --nq-surface-2: #f1f5f9;
        --nq-border: #e2e8f0;
        --nq-border-strong: #cbd5e1;
        --nq-fg: #0f172a;
        --nq-fg-muted: #475569;
        --nq-fg-subtle: #64748b;
        --nq-accent: #2563eb;
        --nq-accent-hover: #1d4ed8;
        --nq-accent-fg: #ffffff;
        --nq-link: #1d4ed8;
    }
}

[data-theme="light"] {
    --nq-bg: #ffffff;
    --nq-surface: #f8fafc;
    --nq-surface-2: #f1f5f9;
    --nq-border: #e2e8f0;
    --nq-border-strong: #cbd5e1;
    --nq-fg: #0f172a;
    --nq-fg-muted: #475569;
    --nq-fg-subtle: #64748b;
    --nq-link: #0c4a6e;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--nq-bg);
    color: var(--nq-fg);
    font-family: var(--nq-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nq-body { min-height: 100vh; display: flex; flex-direction: column; }

a {
    color: var(--nq-link);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

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

code, pre, kbd, samp { font-family: var(--nq-mono); font-size: 0.92em; }

/* Skip link — first focusable element for keyboard users. */
.nq-skip {
    position: absolute;
    left: 0.75rem;
    top: -3rem;
    background: var(--nq-accent);
    color: var(--nq-accent-fg);
    padding: 0.5rem 0.75rem;
    border-radius: var(--nq-radius);
    z-index: 100;
    transition: top 0.15s;
}
.nq-skip:focus { top: 0.5rem; }

/* Top bar — used by all public pages. */
.nq-top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--nq-bg);
    border-bottom: 1px solid var(--nq-border);
}
.nq-top__inner {
    max-width: 1080px;
    margin: 0 auto;
    height: var(--nq-top-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nq-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--nq-fg);
    text-decoration: none;
    font-weight: 600;
    flex-shrink: 0;
}
.nq-brand:hover { text-decoration: none; }
.nq-brand__mark {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: var(--nq-accent);
}
.nq-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.nq-brand__name { font-size: 0.95rem; font-weight: 600; }
.nq-brand__tag { font-size: 0.75rem; color: var(--nq-fg-muted); font-family: var(--nq-mono); }

.nq-nav {
    display: none;
    gap: 1.25rem;
    margin-left: 0.5rem;
}
@media (min-width: 720px) {
    .nq-nav { display: inline-flex; }
}
.nq-nav a {
    color: var(--nq-fg-muted);
    font-size: 0.9rem;
}
.nq-nav a:hover { color: var(--nq-fg); text-decoration: none; }

.nq-top__actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.nq-link-mute {
    color: var(--nq-fg-muted);
    font-size: 0.9rem;
}
.nq-link-mute:hover { color: var(--nq-fg); text-decoration: none; }

/* Buttons. */
.nq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--nq-radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.nq-btn--primary {
    background: var(--nq-accent);
    color: var(--nq-accent-fg);
    border-color: var(--nq-accent);
}
.nq-btn--primary:hover { background: var(--nq-accent-hover); border-color: var(--nq-accent-hover); text-decoration: none; }
.nq-btn--ghost {
    background: transparent;
    color: var(--nq-fg);
    border-color: var(--nq-border-strong);
}
.nq-btn--ghost:hover { border-color: var(--nq-fg-muted); text-decoration: none; }

/* Main + content frame. */
.nq-main {
    flex: 1;
    width: 100%;
}
.nq-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}
.nq-wrap--narrow { max-width: 720px; }

/* Section primitives. */
.nq-section {
    padding: 2.5rem 0;
}
.nq-section--tight { padding: 1.5rem 0; }
.nq-section + .nq-section { border-top: 1px solid var(--nq-border); }
.nq-section__head { margin-bottom: 1.25rem; }
.nq-eyebrow {
    display: inline-block;
    color: var(--nq-fg-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.nq-h1 { font-size: 2rem; line-height: 1.18; margin: 0 0 0.75rem; font-weight: 700; }
.nq-h2 { font-size: 1.5rem; line-height: 1.22; margin: 0 0 0.6rem; font-weight: 700; }
.nq-h3 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 0.35rem; font-weight: 600; }
.nq-lead { font-size: 1.05rem; color: var(--nq-fg-muted); margin: 0 0 1.5rem; max-width: 60ch; }
@media (min-width: 720px) {
    .nq-h1 { font-size: 2.4rem; }
}

.nq-grid { display: grid; gap: 1rem; }
.nq-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nq-grid--3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 720px) { .nq-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.nq-stack { display: flex; flex-direction: column; gap: 1rem; }
.nq-row   { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

.nq-card {
    background: var(--nq-surface);
    border: 1px solid var(--nq-border);
    border-radius: var(--nq-radius-lg);
    padding: 1.1rem 1.25rem;
}
.nq-card--bare { background: transparent; border-color: transparent; padding: 0; }
.nq-card__title { font-weight: 600; margin-bottom: 0.4rem; }
.nq-card__body { color: var(--nq-fg-muted); font-size: 0.94rem; }

.nq-list { list-style: none; padding: 0; margin: 0; }
.nq-list > li { padding: 0.45rem 0; border-top: 1px solid var(--nq-border); }
.nq-list > li:first-child { border-top: 0; }

/* Status badges. */
.nq-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: var(--nq-radius-pill);
    border: 1px solid transparent;
}
.nq-badge--up { background: rgba(22, 163, 74, 0.12); color: var(--nq-success); border-color: rgba(22, 163, 74, 0.35); }
.nq-badge--down { background: rgba(185, 28, 28, 0.12); color: var(--nq-danger); border-color: rgba(185, 28, 28, 0.4); }
.nq-badge--disabled { background: rgba(100, 116, 139, 0.18); color: var(--nq-fg-muted); border-color: var(--nq-border-strong); }
.nq-badge--neutral { background: var(--nq-surface-2); color: var(--nq-fg-muted); border-color: var(--nq-border); }
.nq-badge--accent { background: rgba(37, 99, 235, 0.12); color: var(--nq-accent); border-color: rgba(37, 99, 235, 0.35); }

.nq-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.nq-pulse { animation: nq-pulse 2.4s ease-in-out infinite; }
@keyframes nq-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Code / terminal blocks. */
.nq-code {
    font-family: var(--nq-mono);
    font-size: 0.88rem;
    background: var(--nq-surface-2);
    border: 1px solid var(--nq-border);
    border-radius: var(--nq-radius);
    padding: 0.85rem 1rem;
    overflow-x: auto;
    color: var(--nq-fg);
    white-space: pre;
    line-height: 1.5;
}
.nq-code--inline {
    background: var(--nq-surface-2);
    border: 1px solid var(--nq-border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.86em;
    color: var(--nq-fg);
    white-space: nowrap;
}
.nq-code .nq-prompt { color: var(--nq-fg-subtle); user-select: none; }
.nq-code .nq-comment { color: var(--nq-fg-subtle); }

/* Hero (landing). */
.nq-hero { padding: 0 0 1.5rem; }
.nq-hero__title { font-size: 2.25rem; font-weight: 700; line-height: 1.12; margin: 0 0 1rem; }
.nq-hero__lead { font-size: 1.1rem; color: var(--nq-fg-muted); margin: 0 0 1.5rem; max-width: 56ch; }
@media (min-width: 720px) {
    .nq-hero { padding: 0 0 2rem; }
    .nq-hero__title { font-size: 2.75rem; }
}

/* Region / capability pill grid. */
.nq-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.55rem;
    border-radius: var(--nq-radius-pill);
    background: var(--nq-surface-2);
    border: 1px solid var(--nq-border);
    font-size: 0.78rem;
    color: var(--nq-fg-muted);
    font-family: var(--nq-mono);
}
.nq-pill--ok { color: var(--nq-success); border-color: rgba(22, 163, 74, 0.4); }
.nq-pill--warn { color: var(--nq-warning); border-color: rgba(217, 119, 6, 0.45); }

/* Simple info / notice box. */
.nq-note {
    background: var(--nq-surface);
    border: 1px solid var(--nq-border);
    border-left: 3px solid var(--nq-accent);
    padding: 0.85rem 1rem;
    border-radius: var(--nq-radius);
    color: var(--nq-fg-muted);
    font-size: 0.94rem;
}
.nq-note strong { color: var(--nq-fg); font-weight: 600; }

/* Monitor row (status page). */
.nq-monitor {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    background: var(--nq-surface);
    border: 1px solid var(--nq-border);
    border-radius: var(--nq-radius-lg);
}
.nq-monitor__name { font-weight: 600; }
.nq-monitor__type {
    color: var(--nq-fg-subtle);
    font-size: 0.8rem;
    font-family: var(--nq-mono);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.nq-monitor__right { display: inline-flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.nq-monitor__latency { color: var(--nq-fg-muted); font-size: 0.85rem; font-family: var(--nq-mono); }

/* Footer. */
.nq-foot {
    border-top: 1px solid var(--nq-border);
    padding: 1.5rem 0;
    margin-top: 2rem;
    background: var(--nq-bg);
}
.nq-foot__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--nq-fg-muted);
}
.nq-foot__brand { display: flex; flex-direction: column; gap: 0.2rem; }
.nq-foot__copy { color: var(--nq-fg-muted); }
.nq-foot__meta { color: var(--nq-fg-subtle); font-size: 0.78rem; }
.nq-foot__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.nq-foot__links a { color: var(--nq-fg-muted); }
.nq-foot__links a:hover { color: var(--nq-fg); text-decoration: none; }

/* 404 specifics. */
.nq-error {
    text-align: center;
    padding: 4rem 1rem;
}
.nq-error__code {
    font-family: var(--nq-mono);
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nq-fg-subtle);
    margin: 0 0 0.5rem;
}
.nq-error__title { font-size: 1.6rem; margin: 0 0 0.5rem; }
.nq-error__body { color: var(--nq-fg-muted); max-width: 50ch; margin: 0 auto 1.5rem; }