/*
 * Exypnos Status, dressed as the Exypnos landing: its night palette, its nav (the lockup,
 * quiet links, one outlined Signal Blue pill), flat panels with one-pixel lines, and a
 * word rebuilt in dots where the landing uses one. Status colour appears only on a glyph,
 * a data mark or the dotted verdict word, always beside words that say the same thing.
 */
:root {
    --bg: #07080b;
    --panel: #0c0f14;
    --panel-raised: #12161c;
    --line: rgba(255, 255, 255, 0.075);
    --line-strong: rgba(255, 255, 255, 0.13);
    --ink: #f1f4f8;
    --quiet: #a7acb6;
    --faint: #868d99;
    --signal: #60a5fa;
    --signal-bright: #9ec5fe;
    --signal-wash: rgba(96, 165, 250, 0.12);
    --ok: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
    --idle: #6f7785;
    --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    --step: 10px;
    --hero-h: clamp(520px, 68vh, 700px);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: dark;
}

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

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font: 400 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* The scene's own grid, continued down the page: one dim blue-grey dot per step. */
    background-color: var(--bg);
    background-image: radial-gradient(circle, rgba(170, 195, 225, 0.055) 1px, transparent 1.5px);
    background-size: var(--step) var(--step);
    background-position: calc(var(--step) / -2) calc(var(--step) / -2);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(100% - 56px, 960px); margin-inline: auto; }

.skip {
    position: absolute; left: 16px; top: -48px; z-index: 10;
    padding: 10px 14px; border-radius: 10px;
    background: var(--ink); color: #0b0d11; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── Status glyphs: a shape per state, so state never rests on colour alone ── */
.glyph { display: inline-block; flex: none; width: 10px; height: 10px; background: var(--idle); }
.glyph[data-status="operational"] { background: var(--ok); border-radius: 50%; }
.glyph[data-status="degraded"] { background: var(--warn); clip-path: polygon(50% 4%, 100% 96%, 0 96%); }
.glyph[data-status="outage"] { background: var(--bad); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.glyph[data-status="unknown"] { background: none; border: 1.5px solid var(--idle); border-radius: 50%; }
.glyph[data-status="maintenance"] { background: var(--signal); border-radius: 2px; }

/* ── Hero: the scene, the landing's nav, and the one sentence that matters ── */
.hero { position: relative; min-height: var(--hero-h); display: flex; flex-direction: column; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.nav { position: relative; z-index: 2; padding-top: env(safe-area-inset-top); }
.nav-inner {
    max-width: 1320px; height: 64px; margin: 0 auto;
    padding: 0 max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left));
    display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; border-radius: 8px; }
.lockup { display: block; height: 28px; width: auto; }
.brand-page {
    padding-left: 14px; border-left: 1px solid var(--line-strong);
    color: var(--quiet); font-size: 14px; font-weight: 500; line-height: 20px;
}
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
    padding: 8px 14px; border-radius: 8px;
    color: var(--quiet); font-size: 14px; font-weight: 500; text-decoration: none;
    transition: color 0.18s ease, background 0.18s ease;
}
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
/* The landing's clear CTA: no fill, an accent outline, a pill. */
.nav-cta {
    margin-left: 12px; padding: 9px 18px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent);
    color: var(--signal); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: transform 0.18s var(--ease), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.nav-cta:hover {
    background: color-mix(in srgb, var(--signal) 12%, transparent);
    border-color: var(--signal); color: var(--signal-bright); transform: translateY(-1px);
}
.nav-cta:active { transform: translateY(0); }

.headline {
    position: relative; z-index: 1;
    width: min(100% - 56px, 960px); margin: 0 auto;
    padding-top: clamp(64px, 11vh, 120px);
}
.headline-text { display: inline-block; max-width: 640px; }
.headline h1 {
    font-size: clamp(44px, 5.4vw, 64px); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em;
    text-wrap: balance;
    --dw-top: color-mix(in srgb, var(--signal) 40%, #ffffff);
    --dw-mid: var(--signal);
    --dw-low: color-mix(in srgb, var(--signal) 72%, #000000);
}
.headline h1[data-status="degraded"] { --dw-top: color-mix(in srgb, var(--warn) 45%, #ffffff); --dw-mid: var(--warn); --dw-low: color-mix(in srgb, var(--warn) 70%, #000000); }
.headline h1[data-status="outage"] { --dw-top: color-mix(in srgb, var(--bad) 45%, #ffffff); --dw-mid: var(--bad); --dw-low: color-mix(in srgb, var(--bad) 70%, #000000); }
.dot-word { display: inline-block; line-height: 0; white-space: nowrap; }
.dot-word svg { display: block; overflow: visible; }
.headline-note { margin-top: 18px; color: var(--quiet); font-size: 17px; max-width: 46ch; }

/* Your own browser's reading: one quiet line under the verdict. */
.headline-live {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
    margin-top: 10px; color: var(--faint); font-size: 14px;
}
.headline-live[hidden] { display: none; }
.headline-live strong { color: var(--quiet); font-weight: 500; }
.headline-live .figure { color: var(--ink); font-variant-numeric: tabular-nums; }
.headline-live[data-state="fail"] strong { color: var(--ink); }
.text-button {
    padding: 2px 0; border: 0; background: none; cursor: pointer;
    color: var(--quiet); font-size: 13px; font-weight: 500;
    text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.text-button:hover { color: var(--ink); text-decoration-color: var(--quiet); }
.text-button:disabled { color: var(--faint); cursor: default; }

/* ── Surfaces ── */
main { position: relative; display: grid; gap: 40px; margin-top: -28px; padding-bottom: 72px; }

.slab, .incident-card {
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.slab-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding: 18px 24px 14px;
}
.slab-head h2, .history h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.slab-note { color: var(--faint); font-size: 13px; text-align: right; }

/* ── A service ── */
.svc { padding: 18px 24px 16px; border-top: 1px solid var(--line); }
.svc-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 12px; }
.svc-name { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.svc-state { color: var(--quiet); font-size: 13px; font-weight: 500; white-space: nowrap; }
.svc-state strong { color: var(--ink); font-weight: 500; }
.svc-desc { grid-column: 2 / -1; margin-top: 2px; color: var(--faint); font-size: 13px; }
.svc-detail {
    display: flex; flex-wrap: wrap; gap: 4px 10px;
    margin-top: 10px; padding: 9px 12px;
    border: 1px solid var(--line-strong); border-radius: 10px;
    color: var(--ink); font-size: 13px;
}
.svc-detail span { color: var(--faint); }

.matrix {
    display: block; width: 100%; height: auto; margin-top: 14px;
    overflow: visible; border-radius: 6px; cursor: crosshair; touch-action: pan-y;
}
.matrix .m-ok { fill: var(--ok); opacity: 0.5; }
.matrix .m-deg { fill: var(--warn); }
.matrix .m-down { fill: var(--bad); }
.matrix .m-none { fill: var(--idle); opacity: 0.32; }
.matrix .m-col { fill: transparent; }
.matrix .m-col[data-on] { fill: rgba(241, 244, 248, 0.07); }

.axis {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    margin-top: 8px; color: var(--faint); font-size: 12px;
}
.axis-mid { color: var(--quiet); font-variant-numeric: tabular-nums; }

.more { margin-top: 10px; }
.more > summary {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 28px; padding: 0 2px; border-radius: 6px;
    color: var(--faint); font-size: 12.5px; font-weight: 500; cursor: pointer; list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before {
    content: ""; width: 6px; height: 6px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg); transition: transform 160ms var(--ease);
}
.more[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.more > summary:hover { color: var(--ink); }
.more-body { display: grid; gap: 18px; padding: 12px 0 4px; }
.more-title { color: var(--faint); font-size: 12px; font-weight: 500; margin-bottom: 8px; }

.spark-plot { position: relative; margin-top: 22px; }
.spark { display: block; width: 100%; height: 88px; overflow: visible; cursor: crosshair; touch-action: pan-y; }
.spark .s-line { fill: none; stroke: var(--quiet); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .s-base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark .s-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.spark .s-cross { stroke: var(--faint); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-label {
    position: absolute; left: 0; transform: translateY(-130%);
    color: var(--faint); font: 11px/1 var(--mono); pointer-events: none;
}
.spark-mark {
    position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; pointer-events: none;
    background: var(--warn); clip-path: polygon(50% 4%, 100% 96%, 0 96%);
}
.spark-mark[data-status="outage"] { background: var(--bad); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.spark-note { margin-top: 8px; color: var(--faint); font-size: 12.5px; }

.checks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--quiet); }
.checks code { font: 12.5px/1.4 ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; color: var(--faint); margin-left: 8px; }

.days { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.days th { padding: 0 12px 6px 0; color: var(--faint); font-size: 12px; font-weight: 500; text-align: left; }
.days td { padding: 6px 12px 6px 0; border-top: 1px solid var(--line); color: var(--quiet); }
.days td:first-child { color: var(--ink); }
.empty-note { color: var(--faint); font-size: 13px; }

.legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
    padding: 14px 24px; border-top: 1px solid var(--line);
    color: var(--quiet); font-size: 12.5px;
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-item .glyph { width: 8px; height: 8px; }
.legend-note { margin-left: auto; color: var(--faint); }

/* ── Active incidents ── */
.active { display: grid; gap: 12px; }
.incident-card { padding: 20px 24px; border-color: var(--line-strong); }
.incident-top { display: flex; align-items: baseline; gap: 12px; }
.incident-top .glyph { transform: translateY(-1px); }
.incident-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.incident-meta { margin: 4px 0 0 22px; color: var(--faint); font-size: 13px; }
.updates { display: grid; gap: 14px; margin: 14px 0 0 22px; padding: 0; list-style: none; }
.update-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.update-status { font-weight: 600; }
.update-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.update-body { margin-top: 3px; color: var(--quiet); font-size: 14px; max-width: 70ch; white-space: pre-line; }

/* ── History: one dotted thread per day, each entry a node on it ── */
.history h2 { margin-bottom: 4px; font-size: 16px; }
.day { padding-top: 28px; }
.day-date {
    margin-bottom: 14px;
    color: var(--faint); font: 500 11.5px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.thread { position: relative; display: grid; gap: 22px; padding-left: 28px; }
/* The thread is the page's own dot grid, one column of it. */
.thread::before {
    content: ""; position: absolute; left: 4px; top: 10px; bottom: 6px; width: 2px;
    background-image: radial-gradient(circle, rgba(170, 195, 225, 0.28) 1px, transparent 1.4px);
    background-size: 2px 8px; background-repeat: repeat-y;
}
.entry { position: relative; }
/* A clipped glyph cannot carry a halo, so a patch of page colour breaks the thread behind it. */
.entry::before { content: ""; position: absolute; left: -31px; top: 0; width: 16px; height: 20px; background: var(--bg); }
.entry > .node { position: absolute; left: -28px; top: 5px; width: 10px; height: 10px; }
.entry-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.entry-body { margin-top: 3px; color: var(--faint); font-size: 13px; max-width: 70ch; }
.entry .updates { margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.history-empty {
    margin-top: 16px; padding: 20px 24px;
    border: 1px dashed var(--line-strong); border-radius: 16px;
    color: var(--quiet); background: rgba(7, 8, 11, 0.6);
}

/* ── Footer: the landing's, reduced to what a status page needs ── */
.foot { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, #000); }
.foot-inner {
    max-width: 1320px; margin: 0 auto;
    padding: 40px max(28px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px 40px;
}
.foot-lockup { display: block; height: 22px; width: auto; opacity: 0.9; }
.foot-copy { margin-top: 12px; color: var(--faint); font: 12px/1.4 var(--mono); letter-spacing: 0.01em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.foot-links a { color: var(--quiet); font-size: 14px; text-decoration: none; border-radius: 4px; transition: color 0.16s ease; }
.foot-links a:hover { color: var(--ink); }
.noscript { padding: 24px 0; color: var(--quiet); }

/* ── The one tooltip every data mark shares ── */
.tip {
    position: fixed; z-index: 20; left: 0; top: 0; pointer-events: none;
    min-width: 168px; max-width: 260px; padding: 10px 12px;
    background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    font-size: 12.5px; color: var(--quiet);
}
.tip-title { color: var(--ink); font-weight: 600; font-size: 13px; }
.tip-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tip-row .glyph { width: 7px; height: 7px; }
.tip-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 699px) {
    :root { --step: 12px; --hero-h: 600px; }
    .wrap { width: min(100% - 32px, 960px); }
    .nav-inner { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); gap: 10px; }
    .lockup { height: 22px; }
    .brand-page { padding-left: 10px; font-size: 13px; }
    .nav-links { display: none; }
    .nav-cta { margin-left: auto; padding: 8px 14px; font-size: 13px; }
    .headline { width: calc(100% - 32px); padding-top: 40px; }
    .headline h1 { font-size: 38px; letter-spacing: -0.03em; }
    .headline-note { font-size: 15px; margin-top: 14px; }
    .headline-live { padding: 0; border: 0; background: none; }
    main { gap: 32px; margin-top: -12px; }
    .slab-head, .svc, .legend, .incident-card { padding-inline: 16px; }
    .svc-head { grid-template-columns: auto 1fr; row-gap: 2px; }
    .svc-state { grid-column: 2; }
    .svc-desc { grid-column: 2; }
    .legend-note { margin-left: 0; flex-basis: 100%; }
    .more > summary { min-height: 44px; }
    .text-button { min-height: 32px; }
    .foot-inner { padding-inline: 16px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* A page with no section links still pushes its CTA to the right edge. */
.brand-page + .nav-cta { margin-left: auto; }
