/* Nexov's Gateway status page
 *
 * Self-contained, like the error pages and for the same reason: this is the
 * page people load when the rest of the platform is broken, so it depends on
 * nothing the platform serves except one stylesheet and one script.
 *
 * Built from rules and whitespace rather than cards. An earlier pass stacked
 * three bordered panels with grey header bars, which is what a status page
 * looks like when nobody designed it. Here there is exactly one thing to read
 * first, the headline, and everything under it is a quiet list.
 *
 * Colour is reserved for the three states, so when something turns amber or
 * red it is the only coloured thing on the page.
 */

:root {
    --ink: #0d1117;
    --ink-2: #4a525d;
    --ink-3: #79818d;
    --paper: #ffffff;
    --rule: #e8eaed;
    --rule-2: #d9dce1;

    --ok: #17803d;
    --warn: #92610a;
    --bad: #b3251c;

    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e8ebef;
        --ink-2: #98a1ad;
        --ink-3: #6c7684;
        --paper: #0b0d10;
        --rule: #1e2228;
        --rule-2: #2b3038;

        --ok: #45c46a;
        --warn: #d7a13c;
        --bad: #f2776e;
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--paper);
    color: var(--ink-2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

.wrap {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ── */

.st-header { border-bottom: 1px solid var(--rule); }

.st-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: 54px;
}

.st-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -.01em;
    text-decoration: none;
}

.st-brand img { display: block; }

.st-nav {
    display: flex;
    gap: 16px;
    font-size: 12.5px;
}

.st-nav a { color: var(--ink-3); text-decoration: none; }
.st-nav a:hover { color: var(--ink); }

/* ── Headline ──
 *
 * The one thing the page exists to say. Everything below is reference. */

.st-hero { padding: 40px 0 30px; }

.st-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.st-headline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: var(--ink);
}

.st-headline .st-beacon { align-self: center; }

.st-hero-sub {
    margin-top: 6px;
    padding-left: 20px;
    color: var(--ink-3);
    font-size: 12.5px;
}

.st-sep { color: var(--rule-2); padding: 0 2px; }

/* The headline dot carries a soft halo so the single most important glyph on
 * the page has some presence at 9px. The halo is drawn with box-shadow rather
 * than an extra element so it inherits the state colour automatically. */
.st-beacon {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ink-3);
    flex: none;
}

.is-operational  .st-beacon,
.st-beacon.is-operational  { background: var(--ok);   box-shadow: 0 0 0 3.5px rgb(23 128 61 / .14); }
.is-degraded     .st-beacon,
.st-beacon.is-degraded     { background: var(--warn); box-shadow: 0 0 0 3.5px rgb(146 97 10 / .14); }
.is-major_outage .st-beacon,
.st-beacon.is-major_outage { background: var(--bad);  box-shadow: 0 0 0 3.5px rgb(179 37 28 / .14); }

.st-headline.is-operational  { color: var(--ink); }
.st-headline.is-degraded     { color: var(--warn); }
.st-headline.is-major_outage { color: var(--bad); }

/* ── Service list ──
 *
 * Hairline rules, no container. A border around a list of bordered rows is
 * one box too many. */

.st-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--rule-2);
}

.st-list-title {
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.st-list-note {
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* One line per service. Rows are tighter now that the descriptions are gone,
 * so the list still reads as a list rather than as widely spaced strays. */
.st-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
}

.st-row-label {
    min-width: 0;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -.005em;
}

.st-row-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.st-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-3);
    flex: none;
}

.st-dot.is-operational  { background: var(--ok); }
.st-dot.is-degraded     { background: var(--warn); }
.st-dot.is-major_outage { background: var(--bad); }

.st-row-state.is-operational  { color: var(--ok); }
.st-row-state.is-degraded     { color: var(--warn); }
.st-row-state.is-major_outage { color: var(--bad); }

/* ── Legend ──
 *
 * A footnote, not a panel. It exists so the dots are never the only carrier of
 * meaning; it does not deserve a card of its own. */

.st-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    margin-top: 18px;
    color: var(--ink-3);
    font-size: 11.5px;
}

.st-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Footer ── */

.st-footer { margin-top: 34px; border-top: 1px solid var(--rule); }

.st-footer .wrap {
    padding-top: 14px;
    padding-bottom: 30px;
    color: var(--ink-3);
    font-size: 11.5px;
}

.st-footer a { color: var(--ink-2); }

/* A quiet proof of life. It only animates while the page is polling, so a
 * frozen tab is visibly frozen rather than falsely reassuring. */
.st-pulse {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 5px;
    vertical-align: 1px;
    animation: st-pulse 2.4s ease-in-out infinite;
}

@keyframes st-pulse {
    0%, 100% { opacity: .3; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .st-pulse { animation: none; opacity: .75; }
}

/* ── Narrow ──
 *
 * Rows no longer need to stack. Once the descriptions came off, the longest
 * label and its state share a line comfortably at 320px, so only the padding
 * and the headline scale down. */

@media (max-width: 400px) {
    .wrap { padding: 0 16px; }

    .st-hero { padding: 30px 0 24px; }
    .st-headline { font-size: 17px; }
}
